]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libxml: Fix possible null pointer access (regression 2023-05-26).
authorBruno Haible <bruno@clisp.org>
Fri, 2 Jun 2023 23:21:57 +0000 (01:21 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 2 Jun 2023 23:21:57 +0000 (01:21 +0200)
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

index 55ad9e8d92b7547f9582e1501b2d1bbd453f8e1d..0f70ac1e640909d0375e9d34148b08ee3f0c25f0 100644 (file)
@@ -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.