From: Christos Zoulas Date: Thu, 1 Dec 2016 16:44:47 +0000 (+0000) Subject: PR/583: Lukas Koldrt: Don't attempt to read 0 sized stream. X-Git-Tag: FILE5_30~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db5818858c49bb02391f61047d6b4a4450692e93;p=file PR/583: Lukas Koldrt: Don't attempt to read 0 sized stream. --- diff --git a/src/cdf.c b/src/cdf.c index 94f21633..38d49f71 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.84 2016/10/17 15:25:34 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.85 2016/10/24 18:02:17 christos Exp $") #endif #include @@ -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;