mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 14:42:10 +01:00
GIO: avoid a crash in calling portals
When the OpenUri portal call fails, we were possibly freeing uninitialized memory. Avoid that by initializing path to NULL here. See https://github.com/flatpak/xdg-desktop-portal/issues/173
This commit is contained in:
parent
891026d9fc
commit
7e4a0d8479
@ -203,7 +203,7 @@ open_call_done (GObject *source,
|
||||
GError *error = NULL;
|
||||
gboolean open_file;
|
||||
gboolean res;
|
||||
char *path;
|
||||
char *path = NULL;
|
||||
const char *handle;
|
||||
guint signal_id;
|
||||
|
||||
@ -224,7 +224,7 @@ open_call_done (GObject *source,
|
||||
}
|
||||
|
||||
handle = (const char *)g_object_get_data (G_OBJECT (task), "handle");
|
||||
if (strcmp (handle, path) != 0)
|
||||
if (g_strcmp0 (handle, path) != 0)
|
||||
{
|
||||
signal_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (task), "signal-id"));
|
||||
g_dbus_connection_signal_unsubscribe (connection, signal_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user