Quellcode durchsuchen

Cherry-pick upstream commit FILE5_17-20-g70c65d2: "off by one in out of bounds calculations"

Remaining part of fix for CVE-2014-2270
Christoph Biedl vor 10 Jahren
Ursprung
Commit
40fb851bab
2 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen
  1. 17 0
      debian/patches/cherry-pick.70c65d2.fix-off-by-one.patch
  2. 1 0
      debian/patches/series

+ 17 - 0
debian/patches/cherry-pick.70c65d2.fix-off-by-one.patch

@@ -0,0 +1,17 @@
+Upstream-Author: Christos Zoulas <christos@zoulas.com>
+Date: Tue Mar 4 17:42:19 2014 +0000
+Upstream-Commit: 70c65d2e1841491f59168db1f905e8b14083fb1c
+Description:
+    off by one in out of bounds calculations (Jan Kaluza)
+
+--- a/src/softmagic.c
++++ b/src/softmagic.c
+@@ -71,7 +71,7 @@
+ 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 - 0
debian/patches/series

@@ -13,3 +13,4 @@ cherry-pick.eced9db.python-over-detection.patch
 cherry-pick.c0c0032.fix-memory-leak.patch
 cherry-pick.f9d8564.fix-python-8bit-filenames.patch
 extra.fix-8bit-in-cdf.patch
+cherry-pick.70c65d2.fix-off-by-one.patch