mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 02:46:16 +01:00
gdbus-tool: Check return value of strrchr()
Fixes a crash when invoking gdbus like: $ gdbus emit --session -o / -s Foo https://bugzilla.gnome.org/show_bug.cgi?id=682965
This commit is contained in:
parent
5328f760ee
commit
88d181ef18
@ -625,7 +625,13 @@ handle_emit (gint *argc,
|
||||
g_printerr (_("Error: signal not specified.\n"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
s = strrchr (opt_emit_signal, '.');
|
||||
if (s == NULL)
|
||||
{
|
||||
g_printerr (_("Error: signal must be the fully-qualified name.\n"));
|
||||
goto out;
|
||||
}
|
||||
signal_name = g_strdup (s + 1);
|
||||
interface_name = g_strndup (opt_emit_signal, s - opt_emit_signal);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user