>From 811f4acd6293e160150c37ff470b5027e31c8e92 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 19 Jul 2010 12:24:23 +0200 Subject: Handle failure to hex encode in handle_server_data_anonymous_mech --- dbus/dbus-auth.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c index 3173f34..98b7dee 100644 --- a/dbus/dbus-auth.c +++ b/dbus/dbus-auth.c @@ -1207,12 +1207,16 @@ handle_server_data_anonymous_mech (DBusAuth *auth, DBusString plaintext; DBusString encoded; _dbus_string_init_const (&plaintext, "D-Bus " DBUS_VERSION_STRING); - _dbus_string_init (&encoded); - _dbus_string_hex_encode (&plaintext, 0, - &encoded, - 0); - _dbus_verbose ("%s: try '%s'\n", - DBUS_AUTH_NAME (auth), _dbus_string_get_const_data (&encoded)); + if (_dbus_string_init (&encoded)) + { + _dbus_string_hex_encode (&plaintext, 0, &encoded, 0); + _dbus_verbose ("%s: try '%s'\n", + DBUS_AUTH_NAME (auth), + _dbus_string_get_const_data (&encoded)); + } + else + _dbus_verbose ("%s: try ''\n", + DBUS_AUTH_NAME (auth)); } return send_rejected (auth); } -- 1.7.1.1