aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-04-22 01:42:40 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-04-22 01:42:40 +0800
commitacc879811fe054397727b75f6885a9049e817669 (patch)
treeb6764dd5d7c261194e92ca7bc2f17ca79d5ab322 /mail
parent1eba3d38e0be4aa0df3878098a88b507226aca23 (diff)
downloadgsoc2013-evolution-acc879811fe054397727b75f6885a9049e817669.tar.gz
gsoc2013-evolution-acc879811fe054397727b75f6885a9049e817669.tar.zst
gsoc2013-evolution-acc879811fe054397727b75f6885a9049e817669.zip
Protect against a NULL strv result from parsing the language list string.
2003-04-18 Jeffrey Stedfast <fejj@ximian.com> * mail-composer-prefs.c (spell_set_ui): Protect against a NULL strv result from parsing the language list string. svn path=/trunk/; revision=20903
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-composer-prefs.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 4cd98f177e..89b8a31ff7 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-18 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-composer-prefs.c (spell_set_ui): Protect against a NULL
+ strv result from parsing the language list string.
+
2003-04-17 Jeffrey Stedfast <fejj@ximian.com>
Fixes for bug #41142.
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index 0a01135964..15fbd6fdaf 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -492,16 +492,17 @@ spell_set_ui (MailComposerPrefs *prefs)
GtkTreeIter iter;
GHashTable *present;
gboolean go;
- char **strv;
+ char **strv = NULL;
int i;
prefs->spell_active = FALSE;
/* setup the language list */
- strv = g_strsplit (prefs->language_str, " ", 0);
present = g_hash_table_new (g_str_hash, g_str_equal);
- for (i = 0; strv[i]; i++)
- g_hash_table_insert (present, strv[i], strv[i]);
+ if (prefs->language_str && (strv = g_strsplit (prefs->language_str, " ", 0))) {
+ for (i = 0; strv[i]; i++)
+ g_hash_table_insert (present, strv[i], strv[i]);
+ }
model = (GtkListStore *) gtk_tree_view_get_model (prefs->language);
for (go = gtk_tree_model_get_iter_first ((GtkTreeModel *) model, &iter); go;
@@ -513,7 +514,8 @@ spell_set_ui (MailComposerPrefs *prefs)
}
g_hash_table_destroy (present);
- g_strfreev (strv);
+ if (strv != NULL)
+ g_strfreev (strv);
gnome_color_picker_set_i16 (GNOME_COLOR_PICKER (prefs->colour),
prefs->spell_error_color.red,