Bug fix: El Torito production failed if no catalog name was given and the boot image path contains no slash

This commit is contained in:
Thomas Schmitt 2020-11-07 10:31:52 +01:00
parent 5a98a4cda5
commit b0687643c5

View File

@ -566,10 +566,8 @@ int iso_image_set_boot_image(IsoImage *image, const char *image_path,
/* get both the dir and the name */
catname = strrchr(catdir, '/');
if (catname == NULL) {
free(catdir);
return ISO_WRONG_ARG_VALUE;
}
if (catname == NULL)
catname = catdir;
if (catname == catdir) {
/* we are appending catalog to root node */
parent = image->root;
@ -590,7 +588,8 @@ int iso_image_set_boot_image(IsoImage *image, const char *image_path,
}
parent = (IsoDir*)p;
}
catname++;
if (catname[0] == '/')
catname++;
ret = iso_tree_add_boot_node(parent, catname, &cat_node);
free(catdir);
if (ret < 0) {