unzip: fix CVE-2014-9913 & license

This commit is contained in:
Rasmus Thomsen 2018-10-13 13:42:01 +02:00 committed by maxice8
parent 18d0e5512a
commit f336e81140
2 changed files with 31 additions and 3 deletions

View File

@ -0,0 +1,28 @@
From: "Steven M. Schweda" <sms@antinode.info>
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? */

View File

@ -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 <xtraeme@voidlinux.eu>"
license="Info-ZIP"
homepage="http://infozip.sf.net/"
license="BSD"
distfiles="${SOURCEFORGE_SITE}/infozip/${pkgname}60.tar.gz"
checksum=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37