Skip to content
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

fix incorrect dos date conversion #820

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

Coeur
Copy link
Contributor

@Coeur Coeur commented Nov 10, 2024

When dos_date is 1, mz_zip_dosdate_to_raw_tm should return a date in year 1979.
But the cast with (uint16_t) is incorrectly converting -1 to 65535, which turns the date to year 7441.

The issue may have originated from 35c6102 or earlier (in unzip.c, ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;)

It was fixed in the legacy minizip about three years ago:
madler/zlib@2014a99

@Coeur Coeur changed the title fix incorrect date fix incorrect dos date conversion Nov 10, 2024
@nmoinvaz nmoinvaz added the bug Bug label Nov 11, 2024
@nmoinvaz nmoinvaz merged commit 53e6382 into zlib-ng:develop Nov 11, 2024
28 checks passed
@Coeur Coeur deleted the coeur/mz_zip_dosdate_to_raw_tm branch November 11, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants