X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fxml.c;h=73ba38e41f14b3f0be756048641d57610936098e;hp=2f67c9851fcc8fe331a3c425cadee3e3d8dba2c7;hb=35dd893208119869db6a90b1d1663f9aea88a3f7;hpb=3b293f2984ccd95cf58363ae448deda14224d310 diff --git a/src/xml.c b/src/xml.c index 2f67c985..73ba38e4 100644 --- a/src/xml.c +++ b/src/xml.c @@ -1356,6 +1356,9 @@ WIMLIBAPI int wimlib_set_image_name(WIMStruct *w, int image, const char *name) DEBUG("Setting the name of image %d to %s", image, name); + if (!w) + return WIMLIB_ERR_INVALID_PARAM; + if (!name || !*name) { ERROR("Must specify a non-empty string for the image name"); return WIMLIB_ERR_INVALID_PARAM; @@ -1393,6 +1396,9 @@ WIMLIBAPI int wimlib_set_image_descripton(WIMStruct *w, int image, DEBUG("Setting the description of image %d to %s", image, description); + if (!w) + return WIMLIB_ERR_INVALID_PARAM; + if (image < 1 || image > w->hdr.image_count) { ERROR("%d is not a valid image", image); return WIMLIB_ERR_INVALID_IMAGE;