From cfdfac916971113d1d2e98ca28c26c07ba34ee46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 11 Jan 2022 00:02:02 +0400 Subject: [PATCH] auth: fix a no-memory case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jumping to "out" will call _dbus_string_zero() unconditionally on tmp string variables. Do not attempt to zero what wasn't even initialized. Signed-off-by: Marc-André Lureau --- dbus/dbus-auth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c index 62b5b13c..d4faa737 100644 --- a/dbus/dbus-auth.c +++ b/dbus/dbus-auth.c @@ -525,8 +525,8 @@ sha1_handle_first_client_response (DBusAuth *auth, /* We haven't sent a challenge yet, we're expecting a desired * username from the client. */ - DBusString tmp; - DBusString tmp2; + DBusString tmp = _DBUS_STRING_INIT_INVALID; + DBusString tmp2 = _DBUS_STRING_INIT_INVALID; dbus_bool_t retval = FALSE; DBusError error = DBUS_ERROR_INIT; DBusCredentials *myself = NULL; @@ -557,7 +557,7 @@ sha1_handle_first_client_response (DBusAuth *auth, if (dbus_error_has_name (&error, DBUS_ERROR_NO_MEMORY)) { dbus_error_free (&error); - goto out; + return FALSE; } _dbus_verbose ("%s: Did not get a valid username from client: %s\n",