Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '7zip/Archive/Cab/CabIn.cpp')
-rwxr-xr-x7zip/Archive/Cab/CabIn.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/7zip/Archive/Cab/CabIn.cpp b/7zip/Archive/Cab/CabIn.cpp
index 750b55c2..a9d40726 100755
--- a/7zip/Archive/Cab/CabIn.cpp
+++ b/7zip/Archive/Cab/CabIn.cpp
@@ -237,6 +237,8 @@ HRESULT CInArchive::Open(IInStream *inStream,
item.UnPackSize = ReadUInt32();
item.UnPackOffset = ReadUInt32();
item.FolderIndex = ReadUInt16();
+ if (item.FolderIndex > inArchiveInfo.NumFolders)
+ return S_FALSE;
UInt16 pureDate = ReadUInt16();
UInt16 pureTime = ReadUInt16();
item.Time = ((UInt32(pureDate) << 16)) | pureTime;