From f3479b24b677d256e7621f12bb8ad0783ae30510 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Wed, 19 Aug 2009 08:57:21 -0400 Subject: [PATCH] dbus-gvalue: set an error when demarshal_basic doesn't recognize type By passing dbus_g_proxy_call an incorrect signature, we can cause the function to fail but not provide any error message (if G_DISABLE_ASSERT is defined). As smvc pointed out, this can also become a runtime error when a telepathy CM changes signature, but the client hasn't been updated. As such, g_assert isn't an appropriate action. See http://bugs.debian.org/541632 for more information. This patch causes it to set an error when demarshalling a type that it's not expecting. Instead of a NULL error, one instead sees something like the following when the method returns a path object but the client expected a string: "modem Create() failed: Expected type gchararray, got type code 'o'" Signed-off-by: Andres Salomon --- dbus/dbus-gvalue.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-gvalue.c b/dbus/dbus-gvalue.c index 49ae16e..6ba3663 100644 --- a/dbus/dbus-gvalue.c +++ b/dbus/dbus-gvalue.c @@ -585,8 +585,7 @@ demarshal_basic (DBusGValueMarshalCtx *context, return TRUE; } default: - g_assert_not_reached (); - return FALSE; + /* fall through to invalid_type */ } invalid_type: g_set_error (error, -- 1.6.3.3