[gnome-software] trivial: Fix up a potential NULL dereference



commit 67483dfac8c63a26bf09fc9617aae82d1f12cfbe
Author: Richard Hughes <richard hughsie com>
Date:   Tue Sep 10 10:38:41 2013 +0100

    trivial: Fix up a potential NULL dereference
    
    Spotted by clang...

 src/gs-box.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-box.c b/src/gs-box.c
index 2eb7199..12e9660 100644
--- a/src/gs-box.c
+++ b/src/gs-box.c
@@ -197,6 +197,10 @@ gs_box_get_child_property (GtkContainer *container,
                         break;
                 }
         }
+        if (child == NULL) {
+                GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
+                return;
+        }
 
         switch (property_id) {
         case CHILD_PROP_RELATIVE_SIZE:
@@ -225,6 +229,10 @@ gs_box_set_child_property (GtkContainer *container,
                         break;
                 }
         }
+        if (child == NULL) {
+                GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID (container, property_id, pspec);
+                return;
+        }
 
         switch (property_id) {
         case CHILD_PROP_RELATIVE_SIZE:


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