From: Bruno Haible Date: Fri, 2 Jun 2023 23:21:57 +0000 (+0200) Subject: libxml: Fix possible null pointer access (regression 2023-05-26). X-Git-Tag: v0.22~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb24c965dbd4145d6757f7e2aa65771b4bc08bab;p=thirdparty%2Fgettext.git libxml: Fix possible null pointer access (regression 2023-05-26). Pinpointed by gcc 13 warning: warning: dereference of NULL ‘clone’ [CWE-476] [-Wanalyzer-null-dereference] * gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Assign clone from cloneAttr. --- diff --git a/gnulib-local/lib/libxml/tree.c b/gnulib-local/lib/libxml/tree.c index 55ad9e8d9..0f70ac1e6 100644 --- a/gnulib-local/lib/libxml/tree.c +++ b/gnulib-local/lib/libxml/tree.c @@ -9521,6 +9521,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, goto internal_error; } memset(cloneAttr, 0, sizeof(xmlAttr)); + clone = (xmlNodePtr) cloneAttr; /* * Set hierachical links. * TODO: Change this to add to the end of attributes.