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/util/eab-book-util.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addressbook/util/eab-book-util.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