[evolution-data-server] Bug #726788 - Crash on malformed vCard



commit 7d6f05ac34b4888e76679f2d7c96b6094ad23f26
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Mon Mar 24 15:51:05 2014 +0100

    Bug #726788 - Crash on malformed vCard
    
    If the vcard is "END:VCARD" then the attribute is added to
    the list, then freed. So next time we iterate on attributes it
    will read freed memory and crash.

 addressbook/libebook-contacts/e-vcard.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libebook-contacts/e-vcard.c b/addressbook/libebook-contacts/e-vcard.c
index cba32b8..cf2358c 100644
--- a/addressbook/libebook-contacts/e-vcard.c
+++ b/addressbook/libebook-contacts/e-vcard.c
@@ -763,7 +763,8 @@ parse (EVCard *evc,
                e_vcard_attribute_free (attr);
                attr = NULL;
        } else if (attr) {
-               if (!ignore_uid || g_ascii_strcasecmp (attr->name, EVC_UID) != 0)
+               if ((!ignore_uid || g_ascii_strcasecmp (attr->name, EVC_UID) != 0) &&
+                   g_ascii_strcasecmp (attr->name, "end") != 0)
                        e_vcard_add_attribute (evc, attr);
        }
        while (*p) {


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