From 32387d3f342322724f0a85f8482eaa30d4f35e2e Mon Sep 17 00:00:00 2001 From: zhuofeng Date: Tue, 26 May 2026 17:07:35 +0800 Subject: [PATCH] xmllint: Add NULL checks for xmlStrdup/xmlStrcat in resource loader --- xmllint.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xmllint.c b/xmllint.c index 1219d65b2..b59a962f0 100644 --- a/xmllint.c +++ b/xmllint.c @@ -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)