https://bugs.kde.org/show_bug.cgi?id=403899

--- Comment #5 from Stefan Brüns <stefan.bru...@rwth-aachen.de> ---
Git commit 2bf86d9d8e078513cc5d9f00d8e95544d9990d6c by Stefan Brüns.
Committed on 31/03/2025 at 20:04.
Pushed by bruns into branch 'master'.

Handle Zip64 extra field in central directory

Fix two problems with the current handling of size and relative header
offset in the Central Directory, when these have the special "invalid"
0xffffffff marker value:

- The "Local File Header" may also have "invalid" values for compressed/
  uncompressed size, i.e. when the sizes are recorded in a succeeding
  Data Descriptor.
  Use the Zip64 Extra field, which must be present in this case.
- The "Local Header Offset" in the "Central Directory" may be invalid
  as well, also use the Zip64 Extra field.

The fields in the Central Directory MAY also use the "invalid" value even
if case size and offset would fit in the 32 bit value, and always use the
Zip64 format.

Add two test files, the first exceeds 4 GByte uncompressed and requires
Zip64 format:
$> (echo -en abcd ; dd if=/dev/zero bs=1M count=4200 ; echo -en ABCD) \
  | zip - - | gzip -c - > zip64_extra_zip64_size.zip.gz

The second was created by Windows XPS virtual printer. It uses Zip64
fields although not necessary, all sizes/offsets are small.

A  +-    --    autotests/data/zip64_extra_zip64_localheader.oxps
A  +-    --    autotests/data/zip64_extra_zip64_size.zip.gz
M  +54   -0    autotests/karchivetest.cpp
M  +2    -0    autotests/karchivetest.h
M  +41   -44   src/kzip.cpp

https://invent.kde.org/frameworks/karchive/-/commit/2bf86d9d8e078513cc5d9f00d8e95544d9990d6c

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to