aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2001-07-10 02:00:53 +0800
committerPeter Williams <peterw@src.gnome.org>2001-07-10 02:00:53 +0800
commit04d7e28a0bc12a7f5a30393938a227ad763bfcc6 (patch)
tree9ee739a99a2fd45ce6ba4742cef9c7547eccdc00 /mail/mail-config.c
parent3b70c584967f35faf61e39df0508023c58b43e94 (diff)
downloadgsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.tar
gsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.tar.gz
gsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.tar.bz2
gsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.tar.lz
gsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.tar.xz
gsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.tar.zst
gsoc2013-evolution-04d7e28a0bc12a7f5a30393938a227ad763bfcc6.zip
Some NULL protection for our strings: pgp_key, html_signature, smime_key.
2001-07-09 Peter Williams <peterw@ximian.com> * 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
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c18
1 files changed, 14 insertions, 4 deletions
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);