From c9dd476fa82ffde87ee34d985279a2e128aed451 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Wed, 25 Aug 2021 21:53:24 +0200 Subject: [PATCH] sip: Avoid dereferencing a NULL pointer secret_password_*_finish() may return FALSE without setting the GError. F.e. trying to remove a non existent secret is not a failure. The bug supposedly manifests itself because the updating account credentials from the UI does not always seem to work correctly. --- plugins/sip/calls-sip-provider.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/sip/calls-sip-provider.c b/plugins/sip/calls-sip-provider.c index ccf4c77..03b2d2e 100644 --- a/plugins/sip/calls-sip-provider.c +++ b/plugins/sip/calls-sip-provider.c @@ -210,7 +210,8 @@ on_origin_pw_cleared (GObject *source, g_autoptr (GError) error = NULL; if (!secret_password_clear_finish (result, &error)) - g_warning ("Could not delete the password in the keyring: %s", error->message); + g_warning ("Could not delete the password in the keyring: %s", + error ? error->message : "No reason given"); } @@ -243,7 +244,8 @@ on_origin_pw_saved (GObject *source, g_autoptr (GError) error = NULL; if (!secret_password_store_finish (result, &error)) { - g_warning ("Could not store the password in the keyring: %s", error->message); + g_warning ("Could not store the password in the keyring: %s", + error ? error->message : "No reason given"); } }