-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Names truncated at 256 bytes #690
Comments
If you can do a PR that would be good. |
Yes, it is.
See https://github.com/pmqs/minizip-ng/tree/develop for a fix in progress.
… From: ra-dave
Sent: Friday, May 26, 2023 6:39 PM
To: zlib-ng/minizip-ng
Subject: Re: [zlib-ng/minizip-ng] Names truncated at 256 bytes (Issue #690)
Is this still an issue in minizip-ng 4.0.0?
BTW, Windows 11 can't even open that test.zip file:
https://user-images.githubusercontent.com/24297299/241287067-5a71fecd-d869-4f82-9610-58ea775f3210.png
|
@nmoinvaz, what, if anything, is the minimum version of C that this project supports? In the fix for this issue I had originally written the code below to dynamically allocate space for the
The problem is that code relies on the Variable-length array feature from C99. It would appear that the MSVC build in the github workflow doesn't support that -- see the failure at https://github.com/pmqs/minizip-ng/actions/runs/5110532731/jobs/9186528243 Getting the MSVC build to work means using Currently I've written a POC wrapper function to do the two calls to I'm leaning towards the wrapper solution if C99 isn't a possibility . Opinions welcome. |
Yes you can just use |
Aaah! Didn't know about
|
At top of file:
Then ..
|
Almost, but not quite
this silences the warnings
|
Co-authored-by: Nathan Moinvaziri <[email protected]>
Should be resolved now in the |
While looking at #689 I noticed a number of arrays (
path
,utf8_name
andresolved_name
) with hard-wired lengths inmz_zip_reader_save_all
. The code that uses these arrays looks like it can silently truncate output filenames when the overall path being written exceeds these array lengths.The attached zip file, test.zip, contains a patnh with two 150 character directory names. Individually they are ok, but the combined lengths will result is a path that blows the 256 byte length of the
utf8_name
array.The ultimate payload,
text.txt
, contains thisLets see what
unzip
extractsThat looks fine.
Now try
minizip
. Listing the contents looks okNow for an extract -- the logging looks ok
The extracted data is not correct -- it has truncated at 256 bytes
The text was updated successfully, but these errors were encountered: