Bug fix of previous revision 653:

SIGSEGV because of dereferencing NULL when writing without boot image.
This commit is contained in:
Thomas Schmitt 2010-04-22 23:13:54 +02:00
parent 59d143c1f0
commit ace0d1ab2e

View File

@ -1167,6 +1167,7 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
/* el-torito? */
target->eltorito = (src->bootcat == NULL ? 0 : 1);
target->catalog = src->bootcat;
if (target->catalog != NULL) {
target->num_bootsrc = target->catalog->num_bootimages;
target->bootsrc = calloc(target->num_bootsrc + 1,
sizeof(IsoFileSrc *));
@ -1176,6 +1177,10 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
}
for (i= 0; i < target->num_bootsrc; i++)
target->bootsrc[i] = NULL;
} else {
target->num_bootsrc = 0;
target->bootsrc = NULL;
}
if (opts->system_area_data != NULL) {
system_area = opts->system_area_data;