2007-04-13 [colin] 2.8.1cvs96
authorColin Leroy <colin@colino.net>
Fri, 13 Apr 2007 16:18:45 +0000 (16:18 +0000)
committerColin Leroy <colin@colino.net>
Fri, 13 Apr 2007 16:18:45 +0000 (16:18 +0000)
* src/message_search.c
* src/prefs_display_header.c
* src/summary_search.c
Fix possibles crashes when getting text
from gtk combos

ChangeLog
PATCHSETS
configure.ac
src/message_search.c
src/prefs_display_header.c
src/summary_search.c

index 45b6aecf4335dd6e0c0551cc343cb432c64e3cdb..9d1f61454ce7de16adc2be5d07608101e2376d4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-13 [colin]     2.8.1cvs96
+
+       * src/message_search.c
+       * src/prefs_display_header.c
+       * src/summary_search.c
+               Fix possibles crashes when getting text
+               from gtk combos
+
 2007-04-13 [colin]     2.8.1cvs95
 
        * src/pop.c
 2007-04-13 [colin]     2.8.1cvs95
 
        * src/pop.c
index 8adc20cc88c8c6d5ca56e4f92b259157a1f5b776..c4504adc194e5b29bd02ca4ee718fb406e00af48 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.115.2.151 -r 1.115.2.152 src/main.c;  ) > 2.8.1cvs93.patchset
 ( cvs diff -u -r 1.213.2.140 -r 1.213.2.141 src/folder.c;  ) > 2.8.1cvs94.patchset
 ( cvs diff -u -r 1.56.2.49 -r 1.56.2.50 src/pop.c;  ) > 2.8.1cvs95.patchset
 ( cvs diff -u -r 1.115.2.151 -r 1.115.2.152 src/main.c;  ) > 2.8.1cvs93.patchset
 ( cvs diff -u -r 1.213.2.140 -r 1.213.2.141 src/folder.c;  ) > 2.8.1cvs94.patchset
 ( cvs diff -u -r 1.56.2.49 -r 1.56.2.50 src/pop.c;  ) > 2.8.1cvs95.patchset
+( cvs diff -u -r 1.3.12.24 -r 1.3.12.25 src/message_search.c;  cvs diff -u -r 1.16.2.24 -r 1.16.2.25 src/prefs_display_header.c;  cvs diff -u -r 1.15.2.45 -r 1.15.2.46 src/summary_search.c;  ) > 2.8.1cvs96.patchset
index d71a507f3abcbd8971d17ba08b32c5b5e2190d2c..12a4b4626fa389f9e3c491725cea3f44185f34a7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=95
+EXTRA_VERSION=96
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6d03bdc510a1b456b3f82c6dbf3ea1dc1275caea..afb8b4fe8ce7d9a367f46e979266d0948cfd0de8 100644 (file)
@@ -278,7 +278,7 @@ static void message_search_execute(gboolean backward)
        const gchar *body_str;
 
        body_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
        const gchar *body_str;
 
        body_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
-       if (*body_str == '\0') return;
+       if (!body_str || *body_str == '\0') return;
 
        /* add to history */
        combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.body_entry));
 
        /* add to history */
        combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.body_entry));
index c3f0a676cfb44586760709417efd656893cb59d1..c14388cf342740cf22f217acb7ab443f76a96f47 100644 (file)
@@ -561,7 +561,7 @@ static void prefs_display_header_list_view_set_row(gboolean hidden)
        GtkTreeModel *model;
 
        entry_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(dispheader.hdr_combo));
        GtkTreeModel *model;
 
        entry_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(dispheader.hdr_combo));
-       if (entry_text[0] == '\0') {
+       if (!entry_text || entry_text[0] == '\0') {
                alertpanel_error(_("Header name is not set."));
                return;
        }
                alertpanel_error(_("Header name is not set."));
                return;
        }
index 09eaba11e2a48c23ae24481257ca481b3cc97cd1..22e135b9ddd6f741947706c08868198ca3634011 100644 (file)
@@ -524,7 +524,7 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        search_window.matcher_list = NULL;
                }
                adv_condition = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
                        search_window.matcher_list = NULL;
                }
                adv_condition = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
-               if (adv_condition[0] != '\0') {
+               if (adv_condition && adv_condition[0] != '\0') {
 
                        /* add to history */
                        combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.adv_condition_entry));
 
                        /* add to history */
                        combobox_unset_popdown_strings(GTK_COMBO_BOX(search_window.adv_condition_entry));
@@ -561,6 +561,12 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                subject_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.subject_entry));
                body_str    = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
 
                subject_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.subject_entry));
                body_str    = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
 
+               if (!from_str || !to_str || !subject_str || !body_str) {
+                       /* TODO: warn if no search criteria? (or make buttons enabled only when
+                        * at least one search criteria has been set */
+                       summary_unlock(summaryview);
+                       return;
+               }
                if (    (from_str[0] == '\0') &&
                                (to_str[0] == '\0') &&
                                (subject_str[0] == '\0') &&
                if (    (from_str[0] == '\0') &&
                                (to_str[0] == '\0') &&
                                (subject_str[0] == '\0') &&
@@ -841,7 +847,7 @@ static void adv_condition_btn_clicked(GtkButton *button, gpointer data)
        /* re-use the current search value if it's a condition expression,
           otherwise ignore it silently */
        cond_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
        /* re-use the current search value if it's a condition expression,
           otherwise ignore it silently */
        cond_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
-       if (*cond_str != '\0') {
+       if (cond_str && *cond_str != '\0') {
                matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
        }
 
                matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
        }