Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Commit 189c51c

Browse files
committed
zlib: backport null dereference fix
The curl developers found test case that crashed in their testing when using zlib patched against CVE-2022-37434, same patch we've backported in commit 66dd6bc ("zlib: backport fix for heap-based buffer over-read (CVE-2022-37434)"). So we need to backport following patch in order to fix issue introduced in that previous CVE-2022-37434 fix. References: curl/curl#9271 Fixes: 66dd6bc ("zlib: backport fix for heap-based buffer over-read (CVE-2022-37434)") Signed-off-by: Petr Štetiar <ynezz@true.cz> (cherry picked from commit 6a1b277)
1 parent 5e0c368 commit 189c51c

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

package/libs/zlib/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=zlib
1111
PKG_VERSION:=1.2.11
12-
PKG_RELEASE:=5
12+
PKG_RELEASE:=6
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
1515
PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001
2+
From: Mark Adler <fork@madler.net>
3+
Date: Mon, 8 Aug 2022 10:50:09 -0700
4+
Subject: [PATCH] Fix extra field processing bug that dereferences NULL
5+
state->head.
6+
7+
The recent commit to fix a gzip header extra field processing bug
8+
introduced the new bug fixed here.
9+
---
10+
inflate.c | 4 ++--
11+
1 file changed, 2 insertions(+), 2 deletions(-)
12+
13+
diff --git a/inflate.c b/inflate.c
14+
index 7a7289749..2a3c4fe98 100644
15+
--- a/inflate.c
16+
+++ b/inflate.c
17+
@@ -763,10 +763,10 @@ int flush;
18+
copy = state->length;
19+
if (copy > have) copy = have;
20+
if (copy) {
21+
- len = state->head->extra_len - state->length;
22+
if (state->head != Z_NULL &&
23+
state->head->extra != Z_NULL &&
24+
- len < state->head->extra_max) {
25+
+ (len = state->head->extra_len - state->length) <
26+
+ state->head->extra_max) {
27+
zmemcpy(state->head->extra + len, next,
28+
len + copy > state->head->extra_max ?
29+
state->head->extra_max - len : copy);

0 commit comments

Comments
 (0)