[dia] [scan-build] Dereference of null pointer (maybe)



commit 92e7a46639f090efc87224859705b645f3934965
Author: Hans Breuer <hans breuer org>
Date:   Fri Sep 5 13:10:06 2014 +0200

    [scan-build] Dereference of null pointer (maybe)
    
    Access to field 'len' results in a dereference of a null pointer
    (loaded from variable 'p1')
    File: /home/hb/from-git/dia/lib/diapathrenderer.c
    Line: 887

 lib/diapathrenderer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/lib/diapathrenderer.c b/lib/diapathrenderer.c
index 8786f69..28ec030 100644
--- a/lib/diapathrenderer.c
+++ b/lib/diapathrenderer.c
@@ -884,6 +884,8 @@ create_standard_path_from_list (GList           *objects,
       p2 = NULL;
     }
   }
+  if (!p1)
+    return NULL;
   path = create_standard_path (p1->len, &g_array_index (p1, BezPoint, 0));
   /* copy style from first object processed */
   object_copy_style (path, (DiaObject *)objects->data);


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