Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 42475f006d4789a3e56565f9becbe3f3 > files > 18

file-5.16-1.6.mga4.src.rpm

From 0641e56be1af003aa02c7c6b0184466540637233 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Thu, 7 Aug 2014 09:38:35 +0000
Subject: [PATCH] Prevent wrap around (Remi Collet at redhat)

---
 src/cdf.c | 4 ++++
 1 file changed, 4 insertions(+), 0 deletion(-)

diff --git a/src/cdf.c b/src/cdf.c
index 5dbf3b1..3e691f4 100644
--- a/src/cdf.c
+++ b/src/cdf.c
@@ -835,6 +835,10 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
 		q = (const uint8_t *)(const void *)
 		    ((const char *)(const void *)p + ofs
 		    - 2 * sizeof(uint32_t));
+		if (q < p) {
+			DPRINTF(("Wrapped around %p < %p\n", q, p));
+			goto out;
+		}
 		if (q > e) {
 			DPRINTF(("Ran of the end %p > %p\n", q, e));
 			goto out;
-- 
2.0.4