From fb24c965dbd4145d6757f7e2aa65771b4bc08bab Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 3 Jun 2023 01:21:57 +0200 Subject: [PATCH] libxml: Fix possible null pointer access (regression 2023-05-26). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- gnulib-local/lib/libxml/tree.c | 1 + 1 file changed, 1 insertion(+) 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. -- 2.47.2