[glib] gnetworkmonitornm: Prevent crash



commit 327d35ed414b845e0199a11e8bcbb5296ad70c95
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 5 11:51:46 2015 +0100

    gnetworkmonitornm: Prevent crash
    
    g_dbus_proxy_get_cached_property_names can return NULL if there are no
    cached properties, so don't try to access them in that case.

 gio/gnetworkmonitornm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gio/gnetworkmonitornm.c b/gio/gnetworkmonitornm.c
index 02ff880..73e2ed6 100644
--- a/gio/gnetworkmonitornm.c
+++ b/gio/gnetworkmonitornm.c
@@ -219,6 +219,10 @@ has_property (GDBusProxy *proxy,
   gboolean prop_found = FALSE;
 
   props = g_dbus_proxy_get_cached_property_names (proxy);
+
+  if (!props)
+    return FALSE;
+
   for (i = 0; props[i] != NULL; i++)
     {
       if (g_str_equal (props[i], property_name))


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