diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2010-06-20 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:03 +0300 |
commit | e279500d76f1944ba26526f085030909a2c7ef49 (patch) | |
tree | 130291a48634b2918c6749be8ea360d15e1e202b /CPP/7zip/Archive/Wim/WimIn.cpp | |
parent | 708873490ee36691d84cc06336aac87c5129f8a0 (diff) |
9.159.15
Diffstat (limited to 'CPP/7zip/Archive/Wim/WimIn.cpp')
-rwxr-xr-x | CPP/7zip/Archive/Wim/WimIn.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CPP/7zip/Archive/Wim/WimIn.cpp b/CPP/7zip/Archive/Wim/WimIn.cpp index b65b4c44..4ea028af 100755 --- a/CPP/7zip/Archive/Wim/WimIn.cpp +++ b/CPP/7zip/Archive/Wim/WimIn.cpp @@ -384,7 +384,12 @@ HRESULT CDatabase::ParseDirItem(size_t pos, int parent) return S_FALSE; UInt32 fileNameLen = Get16(p + 0x24); - if ((fileNameLen & 1) != 0 || ((0x26 + fileNameLen + 6) & ~7) != len) + if ((fileNameLen & 1) != 0) + return S_FALSE; + /* Probably different versions of ImageX can use different number of + additional ZEROs. So we don't use exact check. */ + UInt32 fileNameLen2 = (fileNameLen == 0 ? fileNameLen : fileNameLen + 2); + if (((0x26 + fileNameLen2 + 6) & ~7) > len) return S_FALSE; UString name; |