From 605d789820ab1534d507dc2cdad20d686fb3fa2d Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Tue, 18 Apr 2006 12:18:01 +0000 Subject: Protect against possible NULL dereference (#338880). 2006-04-18 Ross Burton * libebook/e-address-western.c: Protect against possible NULL dereference (#338880). --- addressbook/ChangeLog | 5 +++++ addressbook/libebook/e-address-western.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'addressbook') 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 + + * libebook/e-address-western.c: + Protect against possible NULL dereference (#338880). + 2006-04-06 Devashish Sharma * 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); -- cgit v1.2.1