]> granicus.if.org Git - file/commitdiff
PR/583: Lukas Koldrt: Don't attempt to read 0 sized stream.
authorChristos Zoulas <christos@zoulas.com>
Thu, 1 Dec 2016 16:44:47 +0000 (16:44 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 1 Dec 2016 16:44:47 +0000 (16:44 +0000)
src/cdf.c

index d38e793612fcbb2b11e0a9974f53b913cc10a708..68f2c18aa5b7f354854ea04868bcbc1a90d2c677 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.85 2016/10/24 18:02:17 christos Exp $")
+FILE_RCSID("@(#)$File: cdf.c,v 1.86 2016/12/01 16:44:47 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -530,6 +530,9 @@ cdf_read_long_sector_chain(const cdf_info_t *info, const cdf_header_t *h,
        scn->sst_dirlen = len;
        scn->sst_ss = ss;
 
+       if (sid == CDF_SECID_END_OF_CHAIN || len == 0)
+               return cdf_zero_stream(scn);
+
        if (scn->sst_len == (size_t)-1)
                goto out;