commit 605671c5d1f854d8c3fe83e220a3e5651ac9d4e0
parent 1f8a15286c5eb8cda42f4f9b88151900d0dc5fad
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Sat, 9 Apr 2016 15:21:13 +0200
Fix crash on deleting password from passwordstore.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/passwordstore.c b/src/passwordstore.c
@@ -107,7 +107,7 @@ gboolean passwd_store_set(PasswordBlockType block_type,
const gchar *password,
gboolean encrypted)
{
- const gchar *p = password;
+ const gchar *p;
PasswordBlock *block;
gchar *encrypted_password;
@@ -117,8 +117,10 @@ gboolean passwd_store_set(PasswordBlockType block_type,
g_return_val_if_fail(password_id != NULL, FALSE);
/* Empty password string equals null password for us. */
- if (strlen(password) == 0)
+ if (password == NULL || strlen(password) == 0)
p = NULL;
+ else
+ p = password;
debug_print("%s password '%s' in block (%d/%s)%s\n",
(p == NULL ? "Deleting" : "Storing"),