aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorSuman Manjunath <msuman@src.gnome.org>2008-09-01 12:00:00 +0800
committerSuman Manjunath <msuman@src.gnome.org>2008-09-01 12:00:00 +0800
commit07f20eb8fb34789ca0ff9d418545f87bec443b85 (patch)
tree3755855d1459b7cc8329f8593b38a611393e255a /addressbook
parentb352ba9c53b6e279305d9cb94c18c28461324da3 (diff)
downloadgsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.tar
gsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.tar.gz
gsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.tar.bz2
gsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.tar.lz
gsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.tar.xz
gsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.tar.zst
gsoc2013-evolution-07f20eb8fb34789ca0ff9d418545f87bec443b85.zip
Milan Crha <mcrha@redhat.com> ** 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
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c2
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c7
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);