From 07f20eb8fb34789ca0ff9d418545f87bec443b85 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Mon, 1 Sep 2008 04:00:00 +0000 Subject: Milan Crha ** Part of fix for bug #548827 (Check bounds of the string array before accessing elements, show more detailed error message if available). svn path=/trunk/; revision=36237 --- addressbook/ChangeLog | 9 +++++++++ addressbook/gui/widgets/e-addressbook-view.c | 2 +- addressbook/gui/widgets/eab-gui-util.c | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'addressbook') 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 + + ** 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 ** 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); -- cgit