From 7ba1409a1aee5925180de546057ddd84ff267947 Mon Sep 17 00:00:00 2001 From: Remi Collet 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; }