diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /modules/libjar/nsZipArchive.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/libjar/nsZipArchive.cpp')
-rw-r--r-- | modules/libjar/nsZipArchive.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index e0ca373e49..2d845f25f0 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -17,6 +17,7 @@ #include "mozilla/MemUtils.h" #include "mozilla/UniquePtrExtensions.h" #include "mozilla/StaticMutex.h" +#include "mozilla/StaticPrefs_network.h" #include "stdlib.h" #include "nsDirectoryService.h" #include "nsWildCard.h" @@ -242,6 +243,15 @@ nsresult nsZipHandle::Init(nsZipArchive* zip, const char* entry, if (!handle) return NS_ERROR_OUT_OF_MEMORY; LOG(("ZipHandle::Init entry %s", entry)); + + nsZipItem* item = zip->GetItem(entry); + if (item && item->Compression() == DEFLATED && + StaticPrefs::network_jar_max_entry_size()) { + if (item->RealSize() > StaticPrefs::network_jar_max_entry_size()) { + return NS_ERROR_OUT_OF_MEMORY; + } + } + handle->mBuf = MakeUnique<nsZipItemPtr<uint8_t>>(zip, entry); if (!handle->mBuf) return NS_ERROR_OUT_OF_MEMORY; |