From 04d7e28a0bc12a7f5a30393938a227ad763bfcc6 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 9 Jul 2001 18:00:53 +0000 Subject: Some NULL protection for our strings: pgp_key, html_signature, smime_key. 2001-07-09 Peter Williams * mail-config.c (mail_config_write): Some NULL protection for our strings: pgp_key, html_signature, smime_key. Probably we should do this for all strings. Either that or change Bonobo Config. * message-list.c (message_list_init): Explicitly initialize search to NULL. Bug 3951 might to be due to a problem wrt this, and it can't hurt. svn path=/trunk/; revision=10919 --- mail/mail-config.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index 90210e26e8..de98723925 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -605,7 +605,10 @@ mail_config_write (void) /* account pgp options */ path = g_strdup_printf ("/Mail/Accounts/account_pgp_key_%d", i); - bonobo_config_set_string (config->db, path, account->pgp_key, NULL); + if (account->pgp_key) + bonobo_config_set_string (config->db, path, account->pgp_key, NULL); + else + bonobo_config_set_string (config->db, path, "", NULL); g_free (path); path = g_strdup_printf ("/Mail/Accounts/account_pgp_encrypt_to_self_%d", i); @@ -615,8 +618,12 @@ mail_config_write (void) /* account s/mime options */ path = g_strdup_printf ("/Mail/Accounts/account_smime_key_%d", i); - bonobo_config_set_string (config->db, path, - account->smime_key, NULL); + if (account->smime_key) + bonobo_config_set_string (config->db, path, + account->smime_key, NULL); + else + bonobo_config_set_string (config->db, path, + "", NULL); g_free (path); path = g_strdup_printf ("/Mail/Accounts/account_smime_encrypt_to_self_%d", i); @@ -646,7 +653,10 @@ mail_config_write (void) account->id->signature, NULL); g_free (path); path = g_strdup_printf ("identity_html_signature_%d", i); - bonobo_config_set_string (config->db, path, account->id->html_signature, NULL); + if (account->id->html_signature) + bonobo_config_set_string (config->db, path, account->id->html_signature, NULL); + else + bonobo_config_set_string (config->db, path, "", NULL); g_free (path); path = g_strdup_printf ("identity_has_html_signature_%d", i); bonobo_config_set_boolean (config->db, path, account->id->has_html_signature, NULL); -- cgit v1.2.3