From 86fc4635f8b7ba0e736f2df90b20dba456dd6aae Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Wed, 1 Jun 2016 22:25:25 +0000 Subject: [PATCH] PR/551: If we found no sections, return. --- src/cdf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cdf.c b/src/cdf.c index db31c250..1d20453b 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.80 2016/05/06 15:17:10 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.81 2016/06/01 22:21:14 christos Exp $") #endif #include @@ -1068,6 +1068,8 @@ cdf_unpack_catalog(const cdf_header_t *h, const cdf_stream_t *sst, if (b > eb) break; } + if (nr == 0) + return -1; nr--; *cat = CAST(cdf_catalog_t *, malloc(sizeof(cdf_catalog_t) + nr * sizeof(*ce))); -- 2.50.0