From fe98b35afb2f16b4605d15c523c70541997a72de Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 13 Aug 2019 10:13:18 +0200 Subject: [PATCH] Made sure that iso_image_get_bootcat() cannot return non-zero size with NULL content --- libisofs/eltorito.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libisofs/eltorito.c b/libisofs/eltorito.c index 39a3137..ff7ae8a 100644 --- a/libisofs/eltorito.c +++ b/libisofs/eltorito.c @@ -711,13 +711,14 @@ int iso_image_get_bootcat(IsoImage *image, IsoBoot **catnode, uint32_t *lba, return 0; *catnode = bootcat; *lba = bootcat->lba; - *size = bootcat->size; if (bootcat->size > 0 && bootcat->content != NULL) { *content = calloc(1, bootcat->size); if (*content == NULL) return ISO_OUT_OF_MEM; memcpy(*content, bootcat->content, bootcat->size); } + if (*content != NULL) + *size = bootcat->size; return 1; }