1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-10-24 01:09:01 +03:00

xmllint: Add NULL checks for xmlStrdup/xmlStrcat in resource loader

This commit is contained in:
zhuofeng
2026-05-26 17:07:35 +08:00
committed by Daniel Garcia Moreno
parent 174201f747
commit 32387d3f34

View File

@@ -305,7 +305,11 @@ xmllintResourceLoader(void *ctxt, const char *URL,
xmlChar *newURL;
newURL = xmlStrdup((const xmlChar *) lint->paths[i]);
if (newURL == NULL)
return(XML_ERR_NO_MEMORY);
newURL = xmlStrcat(newURL, (const xmlChar *) "/");
if (newURL == NULL)
return(XML_ERR_NO_MEMORY);
newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment);
if (newURL != NULL) {
if (lint->defaultResourceLoader != NULL)