aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-11-30 22:29:34 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-30 22:30:45 +0800
commitab3f65a15e1b6fe5bdf488e6e879899e283ccc43 (patch)
treeac594d423506e1fa1d47fbf057a1ec71947bf7a5 /addressbook
parent1eb7481305d0feda31538d072c206aab5dbdeabd (diff)
downloadgsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.gz
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.bz2
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.lz
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.xz
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.zst
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.zip
Address couple issues found by a Coverity scan
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c2
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c2
-rw-r--r--addressbook/gui/widgets/ea-minicard.c3
3 files changed, 4 insertions, 3 deletions
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
index 7f5dfe1564..7c30b28da8 100644
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ b/addressbook/gui/merging/eab-contact-compare.c
@@ -679,7 +679,7 @@ use_common_book_client (EBookClient *book_client,
EContact *contact = info->contact;
EContactName *contact_name;
GList *contact_email;
- gchar *query_parts[MAX_QUERY_PARTS];
+ gchar *query_parts[MAX_QUERY_PARTS + 1];
gint p = 0;
gchar *contact_file_as, *qj;
EBookQuery *query = NULL;
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 9d7b1826c7..5206041d29 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1439,7 +1439,7 @@ e_addressbook_view_delete_selection (EAddressbookView *view,
}
/* Sets the cursor, at the row after the deleted row */
- if (GAL_IS_VIEW_MINICARD (gal_view) && row != 0) {
+ if (GAL_IS_VIEW_MINICARD (gal_view) && row != 0 && selection_model) {
select = e_sorter_model_to_sorted (selection_model->sorter, row);
/* Sets the cursor, before the deleted row if its the last row */
diff --git a/addressbook/gui/widgets/ea-minicard.c b/addressbook/gui/widgets/ea-minicard.c
index 8a93265d7f..cfa35db349 100644
--- a/addressbook/gui/widgets/ea-minicard.c
+++ b/addressbook/gui/widgets/ea-minicard.c
@@ -140,7 +140,7 @@ ea_minicard_get_name (AtkObject *accessible)
{
#define BUFFERSIZE 500
- static gchar name[BUFFERSIZE];
+ static gchar name[BUFFERSIZE + 1];
GString *new_str = g_string_new (NULL);
gchar *string;
EMinicard *card;
@@ -167,6 +167,7 @@ ea_minicard_get_name (AtkObject *accessible)
/* if there exist no enough space for remain info, return */
if (new_str->len >= BUFFERSIZE) {
strncpy (name, new_str->str, BUFFERSIZE);
+ name[BUFFERSIZE] = '\0';
return name;
}