[libxml2] Silence -Warray-bounds warning



commit d7a334f2d0adb8ef0c4f4b86b0f9a693c4517c37
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Fri Aug 26 14:43:28 2022 +0200

    Silence -Warray-bounds warning
    
    This is a hack, but works for now.
    
    Fixes #389.

 tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tree.c b/tree.c
index d0b5c45d..46d74890 100644
--- a/tree.c
+++ b/tree.c
@@ -9606,7 +9606,8 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
                /*
                * Attributes (xmlAttr).
                */
-               clone = (xmlNodePtr) xmlMalloc(sizeof(xmlAttr));
+                /* Use xmlRealloc to avoid -Warray-bounds warning */
+               clone = (xmlNodePtr) xmlRealloc(NULL, sizeof(xmlAttr));
                if (clone == NULL) {
                    xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node");
                    goto internal_error;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]