blob: ae21e3904887f09f325d150682217d9b5987468d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
From 7ba1409a1aee5925180de546057ddd84ff267947 Mon Sep 17 00:00:00 2001
From: Remi Collet <rcollet@redhat.com>
Date: Thu, 14 Aug 2014 17:19:03 -0700
Subject: [PATCH] Fix bug #67716 - Segfault in cdf.c
Index: b/ext/fileinfo/libmagic/cdf.c
===================================================================
--- a/ext/fileinfo/libmagic/cdf.c
+++ b/ext/fileinfo/libmagic/cdf.c
@@ -759,7 +759,7 @@
for (i = 0; i < sh.sh_properties; i++) {
q = (const uint32_t *)((const char *)p +
CDF_TOLE4(p[(i << 1) + 1])) - 2;
- if (q > e) {
+ if (q < p || q > e) {
DPRINTF(("Ran of the end %p > %p\n", q, e));
goto out;
}
|