-
Notifications
You must be signed in to change notification settings - Fork 3
Check for presence of unexpected entries in the ZIP64 extra field #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'm not understanding what's the goal of |
4832a0f to
5e74d3d
Compare
|
Hey @Its-Just-Nans your analysis is fine. apart from missing the start disk field.
That is what a application that creates zip files should do to keep in step with the APPNOTE.txt But...
The I should probably get it to output a warning message if the ZIP64 fields contains unexpected value -- will add that to my TODO list. |
Yes but it's not mandatory, so if I don't use it, it's not present !
Okay thanks for the feedback I updated my MR |
|
Looking at the change you've added. You've got most of the way there. The patch needs to be applied to the Your change only prints an info message when For example, in this section of code from your patch it either outputs the uncompressed size or it outputs an info message. my $data = substr $zip64Extended, 0, 8, "";
my $value = unpack "Q<", $data;
if (full32 $entry->std_compressedSize)
{
$entry->uncompressedSize($value);
out2 $data, "Uncompressed Size", Value_Q($entry->uncompressedSize)
if $display;
}
else
{
info $data, "Uncompressed Size " . Value_V($value) . " is not used since uncompressedSize is not set to 0xFFFFFFFF"
if $display;
}That is not the way it should work. The logic needs to be more like this (untested) my $data = substr $zip64Extended, 0, 8, "";
my $value = unpack "Q<", $data;
$entry->uncompressedSize($value);
out2 $data, "Uncompressed Size", Value_Q($entry->uncompressedSize);
if (! full32 $entry->std_compressedSize)
{
info $data, "Uncompressed Size should not be present in the ZIP64 extra field. Corresponding uncompressedSize from local/central header is not set to 0xFFFFFFFF, value is ". Value_V($value)
if $display;
}You can update the change if you like, or I can fix it up and merge into my dev copy. |
|
I updated my MR Also another question
Where does this came from ? |
Will take a look later but after a superficial look I don't see anything amiss.
Can't remember offhand. There are a lot of crazy zip files that do crazy things. I'll see if I can find an example. |
|
This change needs to be made against the develop branch. I can always copy the patch & apply manually if needed. |
Sorry, you are correct. It is going into the develop branch. |
Here is an example zip file that fully populates the ZIP64 extra field in the Local header. -- test_zip64.zip. It originated in this ticket ananthakumaran/zstream#18 The values are all zero because this is a streaming zip file. This is from the General Purpose Bitflag
The presence of streaming will need to be checked when working with the local header if (! full32 $entry->std_compressedSize && ! $entry->streamed)I'll sort that while I'm fixing the failed tests. |
Okay thanks for the example. But for me the comment is still incorrect since it's inside the local header function but the comment relates to the data descriptor (which only have no? |
Hello,
I may have found an issue
EDIT: READ THE MR COMMENT #28 (comment)
PER appnote https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
So the previous fields are mandatory since the order is defined
example:
if we use
zip64_uncompressed_sizeANDzip64_compressed_sizewe should have in the blockzip64_uncompressed_sizezip64_compressed_sizeif we use only
zip64_compressed_sizewe should have in the blockzip64_uncompressed_sizezip64_compressed_sizeif we use only zip64_compressed_size we should have in the block
zip64_uncompressed_sizezip64_compressed_sizeif we use only zip64_offset_local_dir we should have in the block
zip64_uncompressed_sizezip64_compressed_sizezip64_offset_local_dir