b77848
From 7ba1409a1aee5925180de546057ddd84ff267947 Mon Sep 17 00:00:00 2001
b77848
From: Remi Collet <rcollet@redhat.com>
b77848
Date: Thu, 14 Aug 2014 17:19:03 -0700
b77848
Subject: [PATCH] Fix bug #67716 - Segfault in cdf.c
b77848
b77848
---
b77848
 NEWS                        | 1 +
b77848
 ext/fileinfo/libmagic/cdf.c | 2 +-
b77848
 2 files changed, 2 insertions(+), 1 deletion(-)
b77848
b77848
diff --git a/ext/fileinfo/libmagic/cdf.c b/ext/fileinfo/libmagic/cdf.c
b77848
index 429f3b9..2c0a2d9 100644
b77848
--- a/ext/fileinfo/libmagic/cdf.c
b77848
+++ b/ext/fileinfo/libmagic/cdf.c
b77848
@@ -820,7 +820,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
b77848
 		q = (const uint8_t *)(const void *)
b77848
 		    ((const char *)(const void *)p + ofs
b77848
 		    - 2 * sizeof(uint32_t));
b77848
-		if (q > e) {
b77848
+		if (q < p || q > e) {
b77848
 			DPRINTF(("Ran of the end %p > %p\n", q, e));
b77848
 			goto out;
b77848
 		}
b77848
-- 
b77848
1.9.2
b77848