Made sure that iso_image_get_bootcat() cannot return non-zero size with NULL content
This commit is contained in:
parent
130b46cf71
commit
fe98b35afb
@ -711,13 +711,14 @@ int iso_image_get_bootcat(IsoImage *image, IsoBoot **catnode, uint32_t *lba,
|
|||||||
return 0;
|
return 0;
|
||||||
*catnode = bootcat;
|
*catnode = bootcat;
|
||||||
*lba = bootcat->lba;
|
*lba = bootcat->lba;
|
||||||
*size = bootcat->size;
|
|
||||||
if (bootcat->size > 0 && bootcat->content != NULL) {
|
if (bootcat->size > 0 && bootcat->content != NULL) {
|
||||||
*content = calloc(1, bootcat->size);
|
*content = calloc(1, bootcat->size);
|
||||||
if (*content == NULL)
|
if (*content == NULL)
|
||||||
return ISO_OUT_OF_MEM;
|
return ISO_OUT_OF_MEM;
|
||||||
memcpy(*content, bootcat->content, bootcat->size);
|
memcpy(*content, bootcat->content, bootcat->size);
|
||||||
}
|
}
|
||||||
|
if (*content != NULL)
|
||||||
|
*size = bootcat->size;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user