mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
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
This commit is contained in:
parent
1f396fd7d6
commit
ca0632ca5c
@ -161,6 +161,9 @@ sync_properties (GNetworkMonitorNM *nm,
|
|||||||
GNetworkConnectivity new_connectivity;
|
GNetworkConnectivity new_connectivity;
|
||||||
|
|
||||||
v = g_dbus_proxy_get_cached_property (nm->priv->proxy, "Connectivity");
|
v = g_dbus_proxy_get_cached_property (nm->priv->proxy, "Connectivity");
|
||||||
|
if (!v)
|
||||||
|
return;
|
||||||
|
|
||||||
nm_connectivity = g_variant_get_uint32 (v);
|
nm_connectivity = g_variant_get_uint32 (v);
|
||||||
g_variant_unref (v);
|
g_variant_unref (v);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user