-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[release/6.0] Upgrade zlib to 1.3.1 #99475
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
Merged
carlossanlop
merged 6 commits into
dotnet:release/6.0-staging
from
carlossanlop:carlossanlop/runtime6-zlib-131
Mar 20, 2024
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fd2e930
[6.0] Upgrade zlib to 1.3.1
carlossanlop 5e23860
Bring in patch to remove implicit narrowing conversions from zlib
carlossanlop eb5664d
Adjust paths of patch for the 6.0 branch
carlossanlop af019d3
[PATCH] Make zlib compile clean against C4244 clang equivalent is
carlossanlop 5b952a4
Update cgmanifest.json and THIRD-PARTY-NOTICES.TXT
carlossanlop e777497
Bring back patches comment, remove unnecessary file removal comment.
carlossanlop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...ystem.IO.Compression.Native/patches/zlib/0001-Make-zlib-compile-clean-against-C4244.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| From 86d96652ddd60f61dc7b0c94b601f6d156d34632 Mon Sep 17 00:00:00 2001 | ||
| From: Levi Broderick <levib@microsoft.com> | ||
| Date: Mon, 28 Aug 2023 15:26:38 -0700 | ||
| Subject: [PATCH] Make zlib compile clean against C4244 clang equivalent is | ||
| "implicit-int-conversion" warning | ||
|
|
||
| The change to deflate.c is legal because 'len' has an upper bound of | ||
| MAX_STORED, which means it fits cleanly into a 16-bit integer. So | ||
| writing out 2x 8-bit values will not result in data loss. | ||
|
|
||
| The change to trees.c is legal because within this loop, 'count' is | ||
| intended to have an upper bound of 138, with the target assignment | ||
| only executing if 'count' is bounded by 4. Neither the 'count' local | ||
| in isolation nor the addition that's part of the target line is | ||
| expected to result in integer overflow. But even if it did, that's a | ||
| matter for a different warning code and doesn't impact the correctness | ||
| of the narrowing cast being considered here. | ||
| --- | ||
| src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c | 8 ++++---- | ||
| src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c | 2 +- | ||
| 2 files changed, 5 insertions(+), 5 deletions(-) | ||
|
|
||
| diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c b/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c | ||
| index d2e1106ef5d..b7636639754 100644 | ||
| --- a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c | ||
| +++ b/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c | ||
| @@ -1738,10 +1738,10 @@ local block_state deflate_stored(s, flush) | ||
| _tr_stored_block(s, (char *)0, 0L, last); | ||
|
|
||
| /* Replace the lengths in the dummy stored block with len. */ | ||
| - s->pending_buf[s->pending - 4] = len; | ||
| - s->pending_buf[s->pending - 3] = len >> 8; | ||
| - s->pending_buf[s->pending - 2] = ~len; | ||
| - s->pending_buf[s->pending - 1] = ~len >> 8; | ||
| + s->pending_buf[s->pending - 4] = (Bytef)len; | ||
| + s->pending_buf[s->pending - 3] = (Bytef)(len >> 8); | ||
| + s->pending_buf[s->pending - 2] = (Bytef)~len; | ||
| + s->pending_buf[s->pending - 1] = (Bytef)(~len >> 8); | ||
|
|
||
| /* Write the stored block header bytes. */ | ||
| flush_pending(s->strm); | ||
| diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c b/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c | ||
| index 5f305c47221..8a3eec559e5 100644 | ||
| --- a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c | ||
| +++ b/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c | ||
| @@ -721,7 +721,7 @@ local void scan_tree(s, tree, max_code) | ||
| if (++count < max_count && curlen == nextlen) { | ||
| continue; | ||
| } else if (count < min_count) { | ||
| - s->bl_tree[curlen].Freq += count; | ||
| + s->bl_tree[curlen].Freq += (ush)count; | ||
| } else if (curlen != 0) { | ||
| if (curlen != prevlen) s->bl_tree[curlen].Freq++; | ||
| s->bl_tree[REP_3_6].Freq++; | ||
| -- | ||
| 2.42.0.windows.1 | ||
|
|
14 changes: 4 additions & 10 deletions
14
src/libraries/Native/Windows/System.IO.Compression.Native/zlib-version.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,9 @@ | ||
| v1.2.13 | ||
| (04f42ceca40f73e2978b50e93806c2a18c1281fc) | ||
| v1.3.1 | ||
| (51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf) | ||
|
|
||
| https://github.com/madler/zlib/releases/tag/v1.2.13 | ||
| https://github.com/madler/zlib/releases/tag/v1.3.1 | ||
|
|
||
| We have removed zlib.3.pdf from our local copy, as it is a binary file which is | ||
| not needed for our compilation. | ||
|
|
||
| We have also cherry-picked into our local copy: | ||
|
|
||
| - https://github.com/madler/zlib/commit/e554695638228b846d49657f31eeff0ca4680e8a | ||
|
|
||
| This patch only affects memLevel 9 compression. .NET doesn't currently use this | ||
| memLevel, but we'll take this patch out of an abundance of caution just in case | ||
| we enable this functionality in a future release. | ||
| The file zlib2ansi was removed in this version release. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.