summaryrefslogtreecommitdiff
path: root/addressbook
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2006-04-18 12:18:01 +0000
committerRoss Burton <rburton@src.gnome.org>2006-04-18 12:18:01 +0000
commit605d789820ab1534d507dc2cdad20d686fb3fa2d (patch)
tree8bf4ae6a3a624a9e3fce590e58b735e55f8d24e3 /addressbook
parentf597595557395dd1020b7a74374281e10392daaa (diff)
downloadevolution-data-server-605d789820ab1534d507dc2cdad20d686fb3fa2d.tar.gz
Protect against possible NULL dereference (#338880).
2006-04-18 Ross Burton <ross@openedhand.com> * libebook/e-address-western.c: Protect against possible NULL dereference (#338880).
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/libebook/e-address-western.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index aa4662cd8..b8a997042 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-18 Ross Burton <ross@openedhand.com>
+
+ * libebook/e-address-western.c:
+ Protect against possible NULL dereference (#338880).
+
2006-04-06 Devashish Sharma <sdevashish@novell.com>
* backends/groupwise/e-book-backend-groupwise.c : Made the function
diff --git a/addressbook/libebook/e-address-western.c b/addressbook/libebook/e-address-western.c
index cb76dcd29..df80cb8a5 100644
--- a/addressbook/libebook/e-address-western.c
+++ b/addressbook/libebook/e-address-western.c
@@ -362,7 +362,10 @@ e_address_western_parse (const gchar *in_address)
/* Convert the newlines at the end of each line (except the last,
because it is already NULL terminated) to NULLs. */
for (cntr = 0; cntr < (linecntr - 1); cntr++) {
- *(strchr (lines[cntr], '\n')) = '\0';
+ char *p;
+ p = strchr (lines[cntr], '\n');
+ if (p)
+ *p = '\0';
}
e_address_western_remove_blank_lines (lines, &linecntr);