From f336e8114033766cfa9918081f1964b3830928da Mon Sep 17 00:00:00 2001 From: Rasmus Thomsen Date: Sat, 13 Oct 2018 13:42:01 +0200 Subject: [PATCH] unzip: fix CVE-2014-9913 & license --- srcpkgs/unzip/patches/CVE-2014-9913.patch | 28 +++++++++++++++++++++++ srcpkgs/unzip/template | 6 ++--- 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/unzip/patches/CVE-2014-9913.patch diff --git a/srcpkgs/unzip/patches/CVE-2014-9913.patch b/srcpkgs/unzip/patches/CVE-2014-9913.patch new file mode 100644 index 00000000000..0124b0d62fc --- /dev/null +++ b/srcpkgs/unzip/patches/CVE-2014-9913.patch @@ -0,0 +1,28 @@ +From: "Steven M. Schweda" +Subject: Fix CVE-2014-9913, buffer overflow in unzip +Bug: https://sourceforge.net/p/infozip/bugs/27/ +Bug-Debian: https://bugs.debian.org/847485 +Bug-Ubuntu: https://launchpad.net/bugs/387350 + +--- list.c ++++ list.c +@@ -339,7 +339,18 @@ + G.crec.compression_method == ENHDEFLATED) { + methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3]; + } else if (methnum >= NUM_METHODS) { +- sprintf(&methbuf[4], "%03u", G.crec.compression_method); ++ /* 2013-02-26 SMS. ++ * http://sourceforge.net/p/infozip/bugs/27/ CVE-2014-9913. ++ * Unexpectedly large compression methods overflow ++ * &methbuf[]. Use the old, three-digit decimal format ++ * for values which fit. Otherwise, sacrifice the ++ * colon, and use four-digit hexadecimal. ++ */ ++ if (G.crec.compression_method <= 999) { ++ sprintf( &methbuf[ 4], "%03u", G.crec.compression_method); ++ } else { ++ sprintf( &methbuf[ 3], "%04X", G.crec.compression_method); ++ } + } + + #if 0 /* GRR/Euro: add this? */ diff --git a/srcpkgs/unzip/template b/srcpkgs/unzip/template index 4fdd0f615bb..c425db6b7aa 100644 --- a/srcpkgs/unzip/template +++ b/srcpkgs/unzip/template @@ -1,13 +1,13 @@ # Template file for 'unzip' pkgname=unzip version=6.0 -revision=11 -makedepends="bzip2-devel" +revision=12 wrksrc=unzip60 +makedepends="bzip2-devel" short_desc="List, test and extract compressed files in a ZIP archive" maintainer="Juan RP " +license="Info-ZIP" homepage="http://infozip.sf.net/" -license="BSD" distfiles="${SOURCEFORGE_SITE}/infozip/${pkgname}60.tar.gz" checksum=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37