evolution-data-server r8434 - in trunk/addressbook: . libebook



Author: msuman
Date: Mon Jan 28 06:02:56 2008
New Revision: 8434
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8434&view=rev

Log:
Patch from Milan Crha  <mcrha redhat com>  ** Fix for bug #386157 (Ensured we don't use freed attribute and stop reading as soon as we found 'END' attribute)

Modified:
   trunk/addressbook/ChangeLog
   trunk/addressbook/libebook/e-vcard.c

Modified: trunk/addressbook/libebook/e-vcard.c
==============================================================================
--- trunk/addressbook/libebook/e-vcard.c	(original)
+++ trunk/addressbook/libebook/e-vcard.c	Mon Jan 28 06:02:56 2008
@@ -619,18 +619,22 @@
 	if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "begin")) {
 		g_warning ("vcard began without a BEGIN:VCARD\n");
 	}
-	if (attr && !g_ascii_strcasecmp (attr->name, "begin"))
+	if (attr && !g_ascii_strcasecmp (attr->name, "begin")) {
 		e_vcard_attribute_free (attr);
-	else if (attr)
+		attr = NULL;
+	} else if (attr)
 		e_vcard_add_attribute (evc, attr);
 
 	while (*p) {
 		EVCardAttribute *next_attr = read_attribute (&p);
 
 		if (next_attr) {
+			attr = next_attr;
+
 			if (g_ascii_strcasecmp (next_attr->name, "end"))
 				e_vcard_add_attribute (evc, next_attr);
-			attr = next_attr;
+			else
+				break;
 		}
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]