Bug fix of previous revision 653:
SIGSEGV because of dereferencing NULL when writing without boot image.
This commit is contained in:
parent
59d143c1f0
commit
ace0d1ab2e
@ -1167,15 +1167,20 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
|
|||||||
/* el-torito? */
|
/* el-torito? */
|
||||||
target->eltorito = (src->bootcat == NULL ? 0 : 1);
|
target->eltorito = (src->bootcat == NULL ? 0 : 1);
|
||||||
target->catalog = src->bootcat;
|
target->catalog = src->bootcat;
|
||||||
target->num_bootsrc = target->catalog->num_bootimages;
|
if (target->catalog != NULL) {
|
||||||
target->bootsrc = calloc(target->num_bootsrc + 1,
|
target->num_bootsrc = target->catalog->num_bootimages;
|
||||||
sizeof(IsoFileSrc *));
|
target->bootsrc = calloc(target->num_bootsrc + 1,
|
||||||
if (target->bootsrc == NULL) {
|
sizeof(IsoFileSrc *));
|
||||||
ret = ISO_OUT_OF_MEM;
|
if (target->bootsrc == NULL) {
|
||||||
goto target_cleanup;
|
ret = ISO_OUT_OF_MEM;
|
||||||
|
goto target_cleanup;
|
||||||
|
}
|
||||||
|
for (i= 0; i < target->num_bootsrc; i++)
|
||||||
|
target->bootsrc[i] = NULL;
|
||||||
|
} else {
|
||||||
|
target->num_bootsrc = 0;
|
||||||
|
target->bootsrc = NULL;
|
||||||
}
|
}
|
||||||
for (i= 0; i < target->num_bootsrc; i++)
|
|
||||||
target->bootsrc[i] = NULL;
|
|
||||||
|
|
||||||
if (opts->system_area_data != NULL) {
|
if (opts->system_area_data != NULL) {
|
||||||
system_area = opts->system_area_data;
|
system_area = opts->system_area_data;
|
||||||
|
Loading…
Reference in New Issue
Block a user