[libxml2/2.10] Silence -Warray-bounds warning



commit bd6326ce2abdd6df84b9e555e9ce5a83c73be852
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 b53fa37e..4c9f00d7 100644
--- a/tree.c
+++ b/tree.c
@@ -9604,7 +9604,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]