From 7dc8600a7f675136a39c39988826c95eb6836389 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 20 Feb 2024 12:32:17 +0100 Subject: [PATCH] SAX2: Report malloc failure in xmlCheckDefaultedAttributes --- SAX2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SAX2.c b/SAX2.c index f102bb6c2..277774c4d 100644 --- a/SAX2.c +++ b/SAX2.c @@ -1304,8 +1304,10 @@ process_external_subset: if (attr->prefix != NULL) { fulln = xmlStrdup(attr->prefix); - fulln = xmlStrcat(fulln, BAD_CAST ":"); - fulln = xmlStrcat(fulln, attr->name); + if (fulln != NULL) + fulln = xmlStrcat(fulln, BAD_CAST ":"); + if (fulln != NULL) + fulln = xmlStrcat(fulln, attr->name); } else { fulln = xmlStrdup(attr->name); }