Skip to content
Snippets Groups Projects
Commit e3c2b16d authored by Salvatore Bonaccorso's avatar Salvatore Bonaccorso Committed by Ritesh Raj Sarraf
Browse files

Import Debian changes 1:1.2.11.dfsg-2+deb11u2

parent 0bb1ef2c
No related branches found
No related tags found
1 merge request!3Draft: Update to bookworm version
zlib (1:1.2.11.dfsg-2+deb11u2) bullseye-security; urgency=high
* Non-maintainer upload by the Security Team.
* Fix a bug when getting a gzip header extra field with inflate()
(CVE-2022-37434) (Closes: #1016710)
* Fix extra field processing bug that dereferences NULL state->head
-- Salvatore Bonaccorso <carnil@debian.org> Tue, 23 Aug 2022 20:54:06 +0200
zlib (1:1.2.11.dfsg-2+deb11u1) bullseye-security; urgency=high
* Non-maintainer upload by the Security Team.
......
From: Mark Adler <fork@madler.net>
Date: Sat, 30 Jul 2022 15:51:11 -0700
Subject: Fix a bug when getting a gzip header extra field with inflate().
Origin: https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1
Bug-Debian: https://bugs.debian.org/1016710
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2022-37434
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.
---
inflate.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/inflate.c b/inflate.c
index 7be8c63662a7..7a728974923a 100644
--- a/inflate.c
+++ b/inflate.c
@@ -763,9 +763,10 @@ int flush;
copy = state->length;
if (copy > have) copy = have;
if (copy) {
+ len = state->head->extra_len - state->length;
if (state->head != Z_NULL &&
- state->head->extra != Z_NULL) {
- len = state->head->extra_len - state->length;
+ state->head->extra != Z_NULL &&
+ len < state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
--
2.36.1
From: Mark Adler <fork@madler.net>
Date: Mon, 8 Aug 2022 10:50:09 -0700
Subject: Fix extra field processing bug that dereferences NULL state->head.
Origin: https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d
The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.
---
inflate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/inflate.c b/inflate.c
index 7a728974923a..2a3c4fe98464 100644
--- a/inflate.c
+++ b/inflate.c
@@ -763,10 +763,10 @@ int flush;
copy = state->length;
if (copy > have) copy = have;
if (copy) {
- len = state->head->extra_len - state->length;
if (state->head != Z_NULL &&
state->head->extra != Z_NULL &&
- len < state->head->extra_max) {
+ (len = state->head->extra_len - state->length) <
+ state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
--
2.36.1
......@@ -2,3 +2,5 @@ cflags-for-minizip
use-dso
use-dso-really
Fix-a-bug-that-can-crash-deflate-on-some-input-when-.patch
Fix-a-bug-when-getting-a-gzip-header-extra-field-wit.patch
Fix-extra-field-processing-bug-that-dereferences-NUL.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment