1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

string: Fix xmlStrncatNew(NULL, "")

This should return "" not NULL.
This commit is contained in:
Nick Wellnhofer
2024-03-06 19:30:43 +01:00
parent 9033a27068
commit aef1ff4372

View File

@@ -499,10 +499,10 @@ xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
if (len < 0)
return(NULL);
}
if ((str2 == NULL) || (len == 0))
return(xmlStrdup(str1));
if (str1 == NULL)
return(xmlStrndup(str2, len));
if ((str2 == NULL) || (len == 0))
return(xmlStrdup(str1));
size = xmlStrlen(str1);
if ((size < 0) || (size > INT_MAX - len))