summaryrefslogtreecommitdiff
path: root/gio/gdbuserror.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-29 13:57:09 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-30 13:17:27 +0100
commite60e4999b9d4904b74e1a38bd5c24b9fd047f95d (patch)
treecc7443617dd7c9cb5fdf764713d8e64797be23fc /gio/gdbuserror.c
parent5156d1b2d42d89d7ad916ca3c53db517a2674f31 (diff)
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
Diffstat (limited to 'gio/gdbuserror.c')
-rw-r--r--gio/gdbuserror.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gio/gdbuserror.c b/gio/gdbuserror.c
index 064c67bd9..946670a7e 100644
--- a/gio/gdbuserror.c
+++ b/gio/gdbuserror.c
@@ -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++)
{