gio: Fix crash in open URI portal when no callback is provided
commit05abc6cfce75c28a354fa69212d8e6f38ce4a8b9
authorPhilip Withnall <withnall@endlessm.com>
Fri, 4 Aug 2017 12:46:46 +0000 (4 13:46 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Mon, 7 Aug 2017 16:08:07 +0000 (7 17:08 +0100)
tree8d0efdeb6f7aa0b90857e2e9054eaf732d921935
parent31ae2c559810675aae483269f234a349cd933528
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>
https://bugzilla.gnome.org/show_bug.cgi?id=785817
gio/gopenuriportal.c