Skip to content

Poco/Zip issue with some CM_DEFLATE archives #1566

@DanielSp-gfk

Description

@DanielSp-gfk

Hi,

I've encountered an issue using Decompress with some archives.
If the archived Deflate stream contains the end header byte sequence 50 4B 07 08 the AutoDetectStream assumes the end of compressed data and decompression fails.
Precondition for this to occur is the "General purpose bit flag" set to 0x08 (referring to field documented in https://en.wikipedia.org/wiki/Zip_(file_format)#File_headers)

Code I'm using:

Poco::FileInputStream inp("archive.zip", std::ios::binary);
if (inp.good()) {
    try {
        Poco::Zip::Decompress dec(inp, ".\\unpacked");
        dec.decompressAllFiles();
    } catch (Poco::Exception& ex) {}
}

I've attached an archive to reproduce the issue. contains_zip_compressed.zip

Unpacking this archive works fine with several other Zip tools.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions