app-arch/sharutils: Add patch for CVE-2018-1000097
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Wed, 13 Mar 2019 12:02:46 +0000 (13:02 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Wed, 13 Mar 2019 12:02:46 +0000 (13:02 +0100)
Bug: https://bugs.gentoo.org/652686
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
app-arch/sharutils/files/sharutils-4.15.2-CVE-2018-1000097.patch [new file with mode: 0644]
app-arch/sharutils/sharutils-4.15.2-r1.ebuild [moved from app-arch/sharutils/sharutils-4.15.2.ebuild with 94% similarity]

diff --git a/app-arch/sharutils/files/sharutils-4.15.2-CVE-2018-1000097.patch b/app-arch/sharutils/files/sharutils-4.15.2-CVE-2018-1000097.patch
new file mode 100644 (file)
index 0000000..f616620
--- /dev/null
@@ -0,0 +1,16 @@
+From: Petr Pisar
+Subject: Fix CVE-2018-1000097, heap buffer overflow in unshar
+Bug-Debian: https://bugs.debian.org/893525
+X-Debian-version: 1:4.15.2-3
+
+--- a/src/unshar.c
++++ b/src/unshar.c
+@@ -240,7 +240,7 @@
+       off_t position = ftello (file);
+ 
+       /* Read next line, fail if no more and no previous process.  */
+-      if (!fgets (rw_buffer, BUFSIZ, file))
++      if (!fgets (rw_buffer, rw_base_size, file))
+       {
+         if (!start)
+           error (0, 0, _("Found no shell commands in %s"), name);
similarity index 94%
rename from app-arch/sharutils/sharutils-4.15.2.ebuild
rename to app-arch/sharutils/sharutils-4.15.2-r1.ebuild
index ab637e3cd2427ec38eb0ec1e376bc491f64cc3a9..2a7873196c5beac5df017550ac523a195b5d9b00 100644 (file)
@@ -25,6 +25,7 @@ src_prepare() {
        default
 
        epatch "${FILESDIR}/sharutils-4.15.2-glibc228.patch"
+       epatch "${FILESDIR}/sharutils-4.15.2-CVE-2018-1000097.patch"
 
        # Upstream is aware but thinks this isn't a bug/problem in sharutils itself
        # See http://lists.gnu.org/archive/html/bug-gnu-utils/2013-10/msg00011.html