mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-27 09:39:08 +01:00
fixed GH #2661: Poco::Zip::ZipArchive cannot load new tomcat.zip file
This commit is contained in:
@@ -52,7 +52,7 @@ ZipFileInfo::ZipFileInfo(const ZipLocalFileHeader& header):
|
|||||||
if (getHostSystem() == ZipCommon::HS_UNIX)
|
if (getHostSystem() == ZipCommon::HS_UNIX)
|
||||||
setUnixAttributes();
|
setUnixAttributes();
|
||||||
|
|
||||||
_rawInfo[GENERAL_PURPOSE_POS+1] |= 0x08; // Set "language encoding flag" to indicate that filenames and paths are in UTF-8.
|
_rawInfo[GENERAL_PURPOSE_POS+1] |= 0x08; // Set "language encoding flag" to indicate that filenames and paths are in UTF-8.
|
||||||
|
|
||||||
if (header.searchCRCAndSizesAfterData())
|
if (header.searchCRCAndSizesAfterData())
|
||||||
_rawInfo[GENERAL_PURPOSE_POS] |= 0x08;
|
_rawInfo[GENERAL_PURPOSE_POS] |= 0x08;
|
||||||
@@ -126,8 +126,7 @@ void ZipFileInfo::parse(std::istream& inp, bool assumeHeaderRead)
|
|||||||
ptr += 2;
|
ptr += 2;
|
||||||
if (id == ZipCommon::ZIP64_EXTRA_ID)
|
if (id == ZipCommon::ZIP64_EXTRA_ID)
|
||||||
{
|
{
|
||||||
poco_assert(size >= 8);
|
if (size >= 8 && getUncompressedSizeFromHeader() == ZipCommon::ZIP64_MAGIC)
|
||||||
if (getUncompressedSizeFromHeader() == ZipCommon::ZIP64_MAGIC)
|
|
||||||
{
|
{
|
||||||
setUncompressedSize(ZipUtil::get64BitValue(ptr, 0));
|
setUncompressedSize(ZipUtil::get64BitValue(ptr, 0));
|
||||||
size -= 8;
|
size -= 8;
|
||||||
|
|||||||
Reference in New Issue
Block a user