]> granicus.if.org Git - file/commitdiff
allow size <= to the size we have not just <
authorChristos Zoulas <christos@zoulas.com>
Tue, 20 Mar 2012 18:28:02 +0000 (18:28 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 20 Mar 2012 18:28:02 +0000 (18:28 +0000)
src/cdf.c

index d05d279e53c330e1d4c2409104b390c7aed51c78..737670935b13f49a3c34d3c8489164c961c99e56 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.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;