[evolution-data-server/gnome-2-30] Skip WebDAV responses which don't begin with BEGIN:VCARD



commit c840dac2a6c4e755e2264db88863619e0104129f
Author: Milan Crha <mcrha redhat com>
Date:   Fri May 7 18:30:16 2010 +0200

    Skip WebDAV responses which don't begin with BEGIN:VCARD
    
    It creates fake contacts.

 .../backends/webdav/e-book-backend-webdav.c        |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index cb9b42f..236d1cf 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -130,6 +130,11 @@ download_contact(EBookBackendWebdav *webdav, const gchar *uri)
 		return NULL;
 	}
 
+	if (message->response_body->length <= 11 || 0 != g_ascii_strncasecmp ((const gchar *) message->response_body->data, "BEGIN:VCARD", 11)) {
+		g_object_unref(message);
+		return NULL;
+	}
+
 	etag = soup_message_headers_get(message->response_headers, "ETag");
 
 	contact = e_contact_new_from_vcard(message->response_body->data);



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