From 86147a23faa53beec0178b0151b13280f8128d9c Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Thu, 24 Jun 2004 22:49:00 +0000 Subject: Don't accept input that doesn't have at least a "BEGIN:VCARD" in it. 2004-06-24 Hans Petter Jansson * util/eab-book-util.c (eab_contact_list_from_string): Don't accept input that doesn't have at least a "BEGIN:VCARD" in it. svn path=/trunk/; revision=26505 --- addressbook/ChangeLog | 5 +++++ addressbook/util/eab-book-util.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 1ffdb3ad50..a74a7ba96b 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2004-06-24 Hans Petter Jansson + + * util/eab-book-util.c (eab_contact_list_from_string): Don't accept + input that doesn't have at least a "BEGIN:VCARD" in it. + 2004-06-24 Radek Doulik * gui/component/select-names/e-select-names-model.c diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c index f6429dee0a..c09cb259bb 100644 --- a/addressbook/util/eab-book-util.c +++ b/addressbook/util/eab-book-util.c @@ -219,6 +219,13 @@ eab_contact_list_from_string (const char *str) temp = g_strdup (q); } + /* Do a minimal well-formedness test, since + * e_contact_new_from_vcard () always returns a contact */ + if (!strstr (p, "BEGIN:VCARD")) { + g_free (temp); + break; + } + contacts = g_list_append (contacts, e_contact_new_from_vcard (temp)); g_free (temp); -- cgit v1.2.3