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 785817 - gio: Fix crash in open URI portal when no callback is provided
gio: Fix crash in open URI portal when no callback is provided
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-08-04 12:49 UTC by Philip Withnall
Modified: 2017-08-07 16:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio: Fix crash in open URI portal when no callback is provided (3.38 KB, patch)
2017-08-04 12:49 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-08-04 12:49:15 UTC
Needs review from whoever wrote the open URI portal code, since the changes are not 100% obvious.
Comment 1 Philip Withnall 2017-08-04 12:49:20 UTC
Created attachment 356954 [details] [review]
gio: Fix crash in open URI portal when no callback is provided

If no callback is provided, token is never set, but it’s then passed to
g_variant_new_string(), which requires a non-NULL input.

Fix that by moving all the option handling inside the (callback != NULL)
case.

Spotted by Coverity (CID #1378714).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Matthias Clasen 2017-08-07 16:01:57 UTC
Review of attachment 356954 [details] [review]:

this looks right to me
Comment 3 Philip Withnall 2017-08-07 16:08:38 UTC
Attachment 356954 [details] pushed as 05abc6c - gio: Fix crash in open URI portal when no callback is provided