mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 16:38:54 +02: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:
@@ -625,7 +625,13 @@ handle_emit (gint *argc,
|
|||||||
g_printerr (_("Error: signal not specified.\n"));
|
g_printerr (_("Error: signal not specified.\n"));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = strrchr (opt_emit_signal, '.');
|
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);
|
signal_name = g_strdup (s + 1);
|
||||||
interface_name = g_strndup (opt_emit_signal, s - opt_emit_signal);
|
interface_name = g_strndup (opt_emit_signal, s - opt_emit_signal);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user