From 14551629e7ef0a680b33cea46a29aa4d8f267c86 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 28 Mar 2011 17:14:25 +0100 Subject: [PATCH 03/25] marshal_basic: if a boolean has a non-boolean value, diagnose the error Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30171 --- dbus/dbus-gvalue.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dbus/dbus-gvalue.c b/dbus/dbus-gvalue.c index d5464b5..379038f 100644 --- a/dbus/dbus-gvalue.c +++ b/dbus/dbus-gvalue.c @@ -1360,10 +1360,13 @@ marshal_basic (DBusMessageIter *iter, const GValue *value) case G_TYPE_BOOLEAN: { dbus_bool_t b = g_value_get_boolean (value); + + g_return_val_if_fail (b == TRUE || b == FALSE, FALSE); + if (!dbus_message_iter_append_basic (iter, DBUS_TYPE_BOOLEAN, &b)) - goto nomem; + oom (); } return TRUE; case G_TYPE_INT: -- 1.7.4.1