summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-09-17 08:13:17 +0000
committerMike Frysinger <vapier@gentoo.org>2005-09-17 08:13:17 +0000
commitcb7e51a1c3123a9b3b8a84145e58f5734f8cd09c (patch)
tree81759701d432beb1fa7010f0792208e2873c40b7 /sys-apps
parentyanked an unneeded DEFINE (diff)
downloadgentoo-2-cb7e51a1c3123a9b3b8a84145e58f5734f8cd09c.tar.gz
gentoo-2-cb7e51a1c3123a9b3b8a84145e58f5734f8cd09c.tar.bz2
gentoo-2-cb7e51a1c3123a9b3b8a84145e58f5734f8cd09c.zip
Add a check for empty buffers #106152.
(Portage version: 2.0.52-r1 http://ronaldmcnightrider.ytmnd.com/ )
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/file/ChangeLog6
-rw-r--r--sys-apps/file/file-4.15.ebuild3
-rw-r--r--sys-apps/file/files/file-4.15-empty-mime-buffer.patch29
3 files changed, 36 insertions, 2 deletions
diff --git a/sys-apps/file/ChangeLog b/sys-apps/file/ChangeLog
index b0ba202783a2..d73f14c085ff 100644
--- a/sys-apps/file/ChangeLog
+++ b/sys-apps/file/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/file
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/ChangeLog,v 1.89 2005/09/17 00:27:23 ciaranm Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/ChangeLog,v 1.90 2005/09/17 08:13:17 vapier Exp $
+
+ 17 Sep 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/file-4.15-empty-mime-buffer.patch, file-4.15.ebuild:
+ Add a check for empty buffers #106152.
17 Sep 2005; Ciaran McCreesh <ciaranm@gentoo.org> ChangeLog:
Converted to UTF-8, fixed encoding screwups
diff --git a/sys-apps/file/file-4.15.ebuild b/sys-apps/file/file-4.15.ebuild
index 7cf2e2471e78..8c8cb4069096 100644
--- a/sys-apps/file/file-4.15.ebuild
+++ b/sys-apps/file/file-4.15.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/file-4.15.ebuild,v 1.3 2005/09/14 04:44:00 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/file/file-4.15.ebuild,v 1.4 2005/09/17 08:13:17 vapier Exp $
inherit distutils libtool
@@ -20,6 +20,7 @@ src_unpack() {
unpack ${P}.tar.gz
cd "${S}"
+ epatch "${FILESDIR}"/${P}-empty-mime-buffer.patch #106152
epatch "${FILESDIR}"/${P}-libtool.patch #99593
elibtoolize
diff --git a/sys-apps/file/files/file-4.15-empty-mime-buffer.patch b/sys-apps/file/files/file-4.15-empty-mime-buffer.patch
new file mode 100644
index 000000000000..aff090c2dc3a
--- /dev/null
+++ b/sys-apps/file/files/file-4.15-empty-mime-buffer.patch
@@ -0,0 +1,29 @@
+http://bugs.gentoo.org/106152
+
+--- src/magic.c
++++ src/magic.c
+@@ -316,12 +316,18 @@ magic_buffer(struct magic_set *ms, const
+ {
+ if (file_reset(ms) == -1)
+ return NULL;
+- /*
+- * The main work is done here!
+- * We have the file name and/or the data buffer to be identified.
+- */
+- if (file_buffer(ms, -1, buf, nb) == -1) {
+- return NULL;
++ if (nb == 0) {
++ if (file_printf(ms, (ms->flags & MAGIC_MIME) ?
++ "application/x-empty" : "empty") == -1)
++ return NULL;
++ } else {
++ /*
++ * The main work is done here!
++ * We have the file name and/or the data buffer to be identified.
++ */
++ if (file_buffer(ms, -1, buf, nb) == -1) {
++ return NULL;
++ }
+ }
+ return file_getbuffer(ms);
+ }