After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 741229 - gio: Handle NULL cached properties in NetworkManager monitor
gio: Handle NULL cached properties in NetworkManager monitor
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-12-07 22:44 UTC by Philip Withnall
Modified: 2017-04-03 11:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio: Handle NULL cached properties in NetworkManager monitor (1.40 KB, patch)
2014-12-07 22:44 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2014-12-07 22:44:44 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.
Comment 1 Philip Withnall 2014-12-07 22:44:47 UTC
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
Comment 2 Philip Withnall 2017-04-03 11:05:31 UTC
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