mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
gdbusconnection: Fix a crash on arg0 matching
If a connection has two signal subscriptions active for the same signal, one with arg0 matching and one without, a signal which doesn’t contain an arg0 value (i.e. `g_dbus_message_get_arg0()` returns `NULL`) will cause `NULL` to be passed to `strcmp()` when checking for a match against the signal subscription which *has* arg0 matching, causing a crash. Fix that by adding the obvious `NULL` check, and add a unit test. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Fixes: #3342
This commit is contained in:
@@ -3929,7 +3929,7 @@ schedule_callbacks (GDBusConnection *connection,
|
||||
(arg0_path == NULL || !path_rule_matches (signal_data->arg0, arg0_path)))
|
||||
continue;
|
||||
}
|
||||
else if (!g_str_equal (signal_data->arg0, arg0))
|
||||
else if (arg0 == NULL || !g_str_equal (signal_data->arg0, arg0))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user