Added some NULL checks in passwordstore.c to avoid potential crash.
authorAndrej Kacian <ticho@claws-mail.org>
Mon, 8 Oct 2018 11:29:21 +0000 (13:29 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Mon, 8 Oct 2018 11:29:21 +0000 (13:29 +0200)
src/passwordstore.c

index 4411711242f712b5093bca23d13d785693283209..cd56c1b0a4db2ca6bbce29ee12b87fbe2b149548 100644 (file)
@@ -307,7 +307,7 @@ void passwd_store_reencrypt_all(const gchar *old_mpwd,
                debug_print("Reencrypting passwords in block (%d/%s).\n",
                                block->block_type, block->block_name);
 
                debug_print("Reencrypting passwords in block (%d/%s).\n",
                                block->block_type, block->block_name);
 
-               if (g_hash_table_size(block->entries) == 0)
+               if (block->entries == NULL || g_hash_table_size(block->entries) == 0)
                        continue;
 
                keys = g_hash_table_get_keys(block->entries);
                        continue;
 
                keys = g_hash_table_get_keys(block->entries);