mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
g_dbus_error_encode_gerror: don't segfault on bad domains
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Matthias Clasen <mclasen@redhat.com> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=660371
This commit is contained in:
parent
5156d1b2d4
commit
e60e4999b9
@ -837,6 +837,10 @@ g_dbus_error_encode_gerror (const GError *error)
|
||||
* hex-encode it for transport across the wire.
|
||||
*/
|
||||
domain_as_string = g_quark_to_string (error->domain);
|
||||
|
||||
/* 0 is not a domain; neither are non-quark integers */
|
||||
g_return_val_if_fail (domain_as_string != NULL, NULL);
|
||||
|
||||
s = g_string_new ("org.gtk.GDBus.UnmappedGError.Quark._");
|
||||
for (n = 0; domain_as_string[n] != 0; n++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user