[glib/glib-2-52] gio: Handle NULL cached properties in NetworkManager monitor
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-52] gio: Handle NULL cached properties in NetworkManager monitor
- Date: Sat, 8 Apr 2017 05:49:49 +0000 (UTC)
commit f7ca0a197e1174f027f945715709c83b746ad730
Author: Philip Withnall <philip tecnocode co uk>
Date: Sun Dec 7 22:41:57 2014 +0000
gio: Handle NULL cached properties in NetworkManager monitor
g_dbus_proxy_get_cached_property() and
g_dbus_proxy_get_cached_property_names() can both return NULL if the
property cache is empty. Avoid a crash if this situation arises (which
it looks like it could, from reading the code) by gracefully bailing out
on NULL return values.
Coverity issues: #1257044, #1257045
https://bugzilla.gnome.org/show_bug.cgi?id=741229
gio/gnetworkmonitornm.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/gnetworkmonitornm.c b/gio/gnetworkmonitornm.c
index afa23f7..5bab65d 100644
--- a/gio/gnetworkmonitornm.c
+++ b/gio/gnetworkmonitornm.c
@@ -161,6 +161,9 @@ sync_properties (GNetworkMonitorNM *nm,
GNetworkConnectivity new_connectivity;
v = g_dbus_proxy_get_cached_property (nm->priv->proxy, "Connectivity");
+ if (!v)
+ return;
+
nm_connectivity = g_variant_get_uint32 (v);
g_variant_unref (v);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]