]> granicus.if.org Git - file/commitdiff
Prevent wrap around (Remi Collet at redhat)
authorChristos Zoulas <christos@zoulas.com>
Thu, 7 Aug 2014 09:38:35 +0000 (09:38 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 7 Aug 2014 09:38:35 +0000 (09:38 +0000)
src/cdf.c

index 5dbf3b13e65eecdb5dc8fb1699a4cdf242d021b1..3e691f4c6c53b1bb0377a68dddae84f222881446 100644 (file)
--- a/src/cdf.c
+++ b/src/cdf.c
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.63 2014/06/09 13:04:37 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.64 2014/07/24 19:35:39 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -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;