]> granicus.if.org Git - file/commitdiff
PR/551: If we found no sections, return.
authorChristos Zoulas <christos@zoulas.com>
Wed, 1 Jun 2016 22:25:25 +0000 (22:25 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 1 Jun 2016 22:25:25 +0000 (22:25 +0000)
src/cdf.c

index 763083fc4775aeac646d447f9d78d9a9d7ae59a3..4ec65b4510d58f4c2f30cb3fa5d3685a3dd5be79 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.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 <assert.h>
@@ -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)));