Skip to content

Commit

Permalink
Prevent wrap around (Remi Collet at redhat)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoulasc committed Aug 7, 2014
1 parent bf3fea9 commit 0641e56
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0641e56

Please sign in to comment.