Made sure that iso_image_get_bootcat() cannot return non-zero size with NULL content

这个提交包含在:
Thomas Schmitt 2019-08-13 10:13:18 +02:00
父节点 130b46cf71
当前提交 fe98b35afb
共有 1 个文件被更改,包括 2 次插入1 次删除

查看文件

@ -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;
}