diff options
-rw-r--r-- | addressbook/ChangeLog | 9 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 7 |
3 files changed, 16 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index f19fefed6a..6a0c16eb41 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,12 @@ +2008-09-01 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #548827 + + * gui/widgets/eab-gui-util.c: (eab_error_dialog): + Check bounds of the string array before accessing elements. + * gui/widgets/e-addressbook-view.c: (delete_contacts_cb): + Show more detailed error message if available. + 2008-08-30 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #548348 diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index ecae7ed8c3..142ed3550f 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1731,7 +1731,7 @@ static void delete_contacts_cb (EBook *book, EBookStatus status, gpointer clos break; default : /* Unknown error */ - e_error_run (NULL, "addressbook:generic-error", _("Failed to delete contact"), _("Other error"), NULL); + eab_error_dialog (_("Failed to delete contact"), status); break; } } diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index 5f21e4da29..ba236da919 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -82,7 +82,12 @@ static const char *status_to_string[] = { void eab_error_dialog (const char *msg, EBookStatus status) { - const char *status_str = status_to_string [status]; + const char *status_str; + + if (status < 0 || status >= G_N_ELEMENTS (status_to_string)) + status_str = "Other error"; + else + status_str = status_to_string [status]; if (status_str) e_error_run (NULL, "addressbook:generic-error", msg, _(status_str), NULL); |