Skip to contentSkip to conversation

unzip: Fix CVE-2019-13232

PATCH New [email protected] 1 participant 1 message Sep 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unzip: Fix CVE-2019-13232

From: Dan Tran <[email protected]>

---
 .../unzip/unzip/CVE-2019-13232_p1.patch       |  33 ++
 .../unzip/unzip/CVE-2019-13232_p2.patch       | 356 ++++++++++++++++++
 .../unzip/unzip/CVE-2019-13232_p3.patch       | 121 ++++++
 meta/recipes-extended/unzip/unzip_6.0.bb      |   3 +
 4 files changed, 513 insertions(+)
 create mode 100644 meta/recipes-extended/unzip/unzip/CVE-2019-13232_p1.patch
 create mode 100644 meta/recipes-extended/unzip/unzip/CVE-2019-13232_p2.patch
 create mode 100644 meta/recipes-extended/unzip/unzip/CVE-2019-13232_p3.patch
meta/recipes-extended/unzip/unzip/CVE-2019-13232_p1.patch new file +33 -0
new file mode 100644
index 0000000000..d485a1bd6e
@@ -0,0 +1,33 @@
+From 080d52c3c9416c731f637f9c6e003961ef43f079 Mon Sep 17 00:00:00 2001
+From: Mark Adler <[email protected]>
+Date: Mon, 27 May 2019 08:20:32 -0700
+Subject: [PATCH 1/3] Fix bug in undefer_input() that misplaced the input
+ state.
+
+CVE: CVE-2019-13232
+Upstream-Status: Backport
+[https://github.com/madler/unzip/commit/41beb477c5744bc396fa1162ee0c14218ec12213]
+
+Signed-off-by: Dan Tran <[email protected]>
+---
+ fileio.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/fileio.c b/fileio.c
+index 7605a29..14460f3 100644
+--- a/fileio.c
++++ b/fileio.c
+@@ -532,8 +532,10 @@ void undefer_input(__G)
+          * This condition was checked when G.incnt_leftover was set > 0 in
+          * defer_leftover_input(), and it is NOT allowed to touch G.csize
+          * before calling undefer_input() when (G.incnt_leftover > 0)
+-         * (single exception: see read_byte()'s  "G.csize <= 0" handling) !!
++         * (single exception: see readbyte()'s  "G.csize <= 0" handling) !!
+          */
++        if (G.csize < 0L)
++            G.csize = 0L;
+         G.incnt = G.incnt_leftover + (int)G.csize;
+         G.inptr = G.inptr_leftover - (int)G.csize;
+         G.incnt_leftover = 0;
+-- 
+2.22.0.vfs.1.1.57.gbaf16c8
meta/recipes-extended/unzip/unzip/CVE-2019-13232_p2.patch new file +356 -0

356 lines not on this page · raw message

meta/recipes-extended/unzip/unzip/CVE-2019-13232_p3.patch new file +121 -0

121 lines not on this page · raw message

meta/recipes-extended/unzip/unzip_6.0.bb +3 -0
index daba722722..c1ea0a9a2c 100644
@@ -22,6 +22,9 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/
 	file://symlink.patch \
 	file://0001-unzip-fix-CVE-2018-1000035.patch \
 	file://CVE-2018-18384.patch \
+	file://CVE-2019-13232_p1.patch \
+	file://CVE-2019-13232_p2.patch \
+	file://CVE-2019-13232_p3.patch \
 "
 UPSTREAM_VERSION_UNKNOWN = "1"
 
Signature · 1 line
2.17.1