X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fxml.c;h=d6c665575119f2080e50117f3e8685fb9eb6be7b;hp=09f567e368a8933502354847ae8e5016ac3e4519;hb=bde99a849d3e7a479cb04a4e16e405b0c2f022dd;hpb=9b9a502863318d6208da2818b1d522346e5eee9e diff --git a/src/xml.c b/src/xml.c index 09f567e3..d6c66557 100644 --- a/src/xml.c +++ b/src/xml.c @@ -1443,7 +1443,7 @@ WIMLIBAPI bool wimlib_image_name_in_use(const WIMStruct *w, const char *name) int i; DEBUG("Checking to see if the image name `%s' is already in use", name); - if (!name || !w->wim_info) + if (!name || !*name || !w->wim_info) return false; for (i = 1; i <= w->wim_info->num_images; i++) if (strcmp(w->wim_info->images[i - 1].name, name) == 0) @@ -1455,6 +1455,9 @@ WIMLIBAPI bool wimlib_image_name_in_use(const WIMStruct *w, const char *name) WIMLIBAPI int wimlib_extract_xml_data(WIMStruct *w, FILE *fp) { DEBUG("Extracting the XML data."); + if (!w->xml_data) + return WIMLIB_ERR_INVALID_PARAM; + if (fwrite(w->xml_data, 1, w->hdr.xml_res_entry.size, fp) != w->hdr.xml_res_entry.size) { ERROR_WITH_ERRNO("Failed to extract XML data");