From 105a24e15bede0183b4f92082546478ce205312e 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 763083fc..4ec65b45 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.81 2016/06/01 22:21:14 christos Exp $") +FILE_RCSID("@(#)$File: cdf.c,v 1.82 2016/06/01 22:25:25 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.40.0