]> wimlib.net Git - wimlib/blobdiff - src/xml.c
wimlib_set_image_property(): forbid NULL or empty property names
[wimlib] / src / xml.c
index e29030c69b59b4f199ebcf876cc4cfaf330d3ab3..dbce8da606e1ae971680a2e2bf1cc37119bf30bd 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -1388,6 +1388,8 @@ wimlib_get_image_property(const WIMStruct *wim, int image,
        const xmlChar *name;
        const tchar *value;
 
+       if (!property_name || !*property_name)
+               return NULL;
        if (tstr_get_utf8(property_name, &name))
                return NULL;
        value = get_image_property(wim, image, name, NULL);
@@ -1423,6 +1425,9 @@ wimlib_set_image_property(WIMStruct *wim, int image, const tchar *property_name,
        const xmlChar *name;
        int ret;
 
+       if (!property_name || !*property_name)
+               return WIMLIB_ERR_INVALID_PARAM;
+
        ret = tstr_get_utf8(property_name, &name);
        if (ret)
                return ret;