[dia] [warningectomy] 'new_obj' may be used uninitialized in this function



commit 6bfc507f687e2ac72173c0dd753b85f40930080a
Author: Hans Breuer <hans breuer org>
Date:   Sat May 4 13:08:32 2013 +0200

    [warningectomy] 'new_obj' may be used uninitialized in this function
    
    Now a completely borked svg:image should do no harm anymore,
    i.e. gets silently ignored.

 plug-ins/svg/svg-import.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/svg/svg-import.c b/plug-ins/svg/svg-import.c
index 2a50040..78dd5dc 100644
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -885,7 +885,7 @@ read_image_svg(xmlNodePtr node, DiaSvgStyle *parent_style, GList *list, const gc
 {
   xmlChar *str;
   real x = 0, y = 0, width = 0, height = 0;
-  DiaObject *new_obj;
+  DiaObject *new_obj = NULL;
   DiaMatrix *matrix = NULL;
 
   str = xmlGetProp(node, (const xmlChar *)"transform");
@@ -970,7 +970,10 @@ read_image_svg(xmlNodePtr node, DiaSvgStyle *parent_style, GList *list, const gc
     xmlFree(str);
   }
 
-  return g_list_append (list, new_obj);
+  if (new_obj)
+    return g_list_append (list, new_obj);
+
+  return list;
 }
 
 /* GFunc for foreach */


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