summaryrefslogtreecommitdiff
path: root/core/file
diff options
context:
space:
mode:
Diffstat (limited to 'core/file')
-rw-r--r--core/file/PKGBUILD17
-rw-r--r--core/file/file-5.17-off-by-one.patch25
2 files changed, 38 insertions, 4 deletions
diff --git a/core/file/PKGBUILD b/core/file/PKGBUILD
index 818a8f0f2..859091149 100644
--- a/core/file/PKGBUILD
+++ b/core/file/PKGBUILD
@@ -1,18 +1,27 @@
-# $Id: PKGBUILD 205932 2014-02-14 08:16:42Z allan $
+# $Id: PKGBUILD 207101 2014-03-06 12:36:01Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Andreas Radke <andyrtr@archlinux.org>
pkgname=file
pkgver=5.17
-pkgrel=1
+pkgrel=2
pkgdesc="File type identification utility"
arch=('i686' 'x86_64')
license=('custom')
groups=('base' 'base-devel')
url="http://www.darwinsys.com/file/"
depends=('glibc' 'zlib')
-source=(ftp://ftp.astron.com/pub/${pkgname}/${pkgname}-${pkgver}.tar.gz)
-md5sums=('e19c47e069ced7b01ccb4db402cc01d3')
+source=(ftp://ftp.astron.com/pub/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ file-5.17-off-by-one.patch)
+md5sums=('e19c47e069ced7b01ccb4db402cc01d3'
+ 'f36a87784f1db2e415ce09badb38fbe8')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # https://github.com/file/file/commit/70c65d2e1841
+ patch -p1 -i $srcdir/file-5.17-off-by-one.patch
+}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
diff --git a/core/file/file-5.17-off-by-one.patch b/core/file/file-5.17-off-by-one.patch
new file mode 100644
index 000000000..0e8beb442
--- /dev/null
+++ b/core/file/file-5.17-off-by-one.patch
@@ -0,0 +1,25 @@
+From 70c65d2e1841491f59168db1f905e8b14083fb1c Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Tue, 4 Mar 2014 17:42:19 +0000
+Subject: [PATCH] off by one in out of bounds calculations (Jan Kaluza)
+
+---
+ src/softmagic.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/softmagic.c b/src/softmagic.c
+index 170de95..5ed3998 100644
+--- a/src/softmagic.c
++++ b/src/softmagic.c
+@@ -72,7 +72,7 @@ private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
+ private void cvt_32(union VALUETYPE *, const struct magic *);
+ private void cvt_64(union VALUETYPE *, const struct magic *);
+
+-#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) >= ((n) - (o)))
++#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o)))
+ /*
+ * softmagic - lookup one file in parsed, in-memory copy of database
+ * Passed the name and FILE * of one file to be typed.
+--
+1.8.5.5
+