From e202ac9d1968961ca9ad7729fd6b4f93dee8ad5c Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sun, 11 Mar 2012 12:40:52 +0100 Subject: [PATCH] Fix critical assertion when secret_password_lookup_xx() returns null. --- library/secret-password.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/secret-password.c b/library/secret-password.c index 7760003..e40a29d 100644 --- a/library/secret-password.c +++ b/library/secret-password.c @@ -552,6 +552,9 @@ secret_password_lookup_nonpageable_finish (GAsyncResult *result, return NULL; closure = g_simple_async_result_get_op_res_gpointer (res); + if (closure->value == NULL) + return NULL; + content_type = secret_value_get_content_type (closure->value); if (content_type && g_str_equal (content_type, "text/plain")) { password = _secret_value_unref_to_password (closure->value); @@ -589,6 +592,9 @@ secret_password_lookup_finish (GAsyncResult *result, return NULL; closure = g_simple_async_result_get_op_res_gpointer (res); + if (closure->value == NULL) + return NULL; + content_type = secret_value_get_content_type (closure->value); if (content_type && g_str_equal (content_type, "text/plain")) { string = _secret_value_unref_to_string (closure->value);