bzip2: Fix CVE-2016-3189
authorRosen Penev <rosenp@gmail.com>
Thu, 23 Aug 2018 02:07:56 +0000 (19:07 -0700)
committerJo-Philipp Wich <jo@mein.io>
Thu, 30 Aug 2018 11:15:06 +0000 (13:15 +0200)
Issue causes a crash with specially crafted bzip2 files.

More info: https://nvd.nist.gov/vuln/detail/CVE-2016-3189

Taken from Fedora.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit f9469efbfa7ce892651f9a6da713eacbef66f177)

package/utils/bzip2/Makefile
package/utils/bzip2/patches/010-CVE-2016-3189.patch [new file with mode: 0644]

index 62c255a907e8748018a1f4b3f4db468caf3f3c03..42b2e4f01bf89e6fb85baf5062a213aa17e85409 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bzip2
 PKG_VERSION:=1.0.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.bzip.org/$(PKG_VERSION)
diff --git a/package/utils/bzip2/patches/010-CVE-2016-3189.patch b/package/utils/bzip2/patches/010-CVE-2016-3189.patch
new file mode 100644 (file)
index 0000000..064f982
--- /dev/null
@@ -0,0 +1,11 @@
+diff -up ./bzip2recover.c.old ./bzip2recover.c
+--- ./bzip2recover.c.old       2016-03-22 08:49:38.855620000 +0100
++++ ./bzip2recover.c   2016-03-30 10:22:27.341430099 +0200
+@@ -457,6 +457,7 @@ Int32 main ( Int32 argc, Char** argv )
+             bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
+             bsPutUInt32 ( bsWr, blockCRC );
+             bsClose ( bsWr );
++            outFile = NULL;
+          }
+          if (wrBlock >= rbCtr) break;
+          wrBlock++;