Skip to content

Rewrite KZip file parsing

Albert Astals Cid requested to merge work/aacid/450597 into master

The old file parser was reading the file in order looking for the local header and central directory header markers, but that breaks when those markers are part of the data of the files inside the zip file itself.

The correct way is to scan for the end of central directory record signature and then from there use the offsets to jump to the rest of the data.

BUGS: 450597


  • Doesn't work on sequential IO devices, do we care?
  • The two test files introduced because of fail, the end of central directory record has a broken offset, do we care? Ark (using libarchive?) can't open them either
  • Add an autotest with the files that didn't use to work and now work
Edited by Albert Astals Cid

Merge request reports