summaryrefslogtreecommitdiff
path: root/src/cdf.c
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2012-03-20 18:28:02 +0000
committerChristos Zoulas <christos@zoulas.com>2012-03-20 18:28:02 +0000
commit2f991a4b47e42689c106129a1946f0a85fa11632 (patch)
tree5d9a85d77f6491cc0764ab1c07192828dd8c44b0 /src/cdf.c
parent6906c79c449ca5dd19914caf4f2cf31a94c280ed (diff)
downloadfile-git-2f991a4b47e42689c106129a1946f0a85fa11632.tar.gz
allow size <= to the size we have not just <
Diffstat (limited to 'src/cdf.c')
-rw-r--r--src/cdf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cdf.c b/src/cdf.c
index d05d279e..73767093 100644
--- a/src/cdf.c
+++ b/src/cdf.c
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf.c,v 1.50 2012/02/20 22:35:29 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.51 2012/03/20 18:28:02 christos Exp $")
#endif
#include <assert.h>
@@ -268,10 +268,10 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h,
const char *b = (const char *)sst->sst_tab;
const char *e = ((const char *)p) + tail;
(void)&line;
- if (e >= b && (size_t)(e - b) < CDF_SEC_SIZE(h) * sst->sst_len)
+ if (e >= b && (size_t)(e - b) <= CDF_SEC_SIZE(h) * sst->sst_len)
return 0;
- DPRINTF(("%d: offset begin %p end %p %" SIZE_T_FORMAT "u"
- " >= %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
+ DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
+ " > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len));
errno = EFTYPE;