GNOME Bugzilla – Bug 741229
gio: Handle NULL cached properties in NetworkManager monitor
Last modified: 2017-04-03 11:05:35 UTC
Trivial patch attached. From reading the code, I believe it would be possible for this NULL return case to happen if running with an old NetworkManager version; but I haven’t actually reproduced it in practice.
Created attachment 292271 [details] [review] 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
Pushing without review, since this is clearly correct. Since this patch was originally posted, commit 327d35ed414b845e0199a11e8bcbb5296ad70c95 fixed half of the problem, providing a good example of when static analysis does find real-world problems faster than manual testing. Attachment 292271 [details] pushed as ca0632c - gio: Handle NULL cached properties in NetworkManager monitor