[evolution-data-server] Bug 722270 - Crash under WebDAV's send_propfind()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 722270 - Crash under WebDAV's send_propfind()
- Date: Tue, 28 Jul 2015 05:28:04 +0000 (UTC)
commit 771f1e3f1fc29bb9168534624ff352384ac37d5e
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 28 07:27:38 2015 +0200
Bug 722270 - Crash under WebDAV's send_propfind()
.../backends/webdav/e-book-backend-webdav.c | 22 +++++++++++++++++--
1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c
b/addressbook/backends/webdav/e-book-backend-webdav.c
index f5ceb06..b84cc6d 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -574,7 +574,8 @@ parse_propfind_response (xmlTextReaderPtr reader)
static SoupMessage *
send_propfind (EBookBackendWebdav *webdav,
- GCancellable *cancellable)
+ GCancellable *cancellable,
+ GError **error)
{
SoupMessage *message;
EBookBackendWebdavPrivate *priv = webdav->priv;
@@ -583,6 +584,11 @@ send_propfind (EBookBackendWebdav *webdav,
"<propfind xmlns=\"DAV:\"><prop><getetag/></prop></propfind>";
message = soup_message_new (SOUP_METHOD_PROPFIND, priv->uri);
+ if (!message) {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, _("Malformed URI: %s"),
priv->uri);
+ return NULL;
+ }
+
soup_message_headers_append (message->request_headers, "User-Agent", USERAGENT);
soup_message_headers_append (message->request_headers, "Connection", "close");
soup_message_headers_append (message->request_headers, "Depth", "1");
@@ -830,7 +836,15 @@ download_contacts (EBookBackendWebdav *webdav,
_("Loading Addressbook summary..."));
}
- message = send_propfind (webdav, cancellable);
+ message = send_propfind (webdav, cancellable, error);
+ if (!message) {
+ g_free (new_ctag);
+ if (book_view)
+ e_data_book_view_notify_progress (book_view, -1, NULL);
+ g_mutex_unlock (&priv->update_lock);
+ return FALSE;
+ }
+
status = message->status_code;
if (status == SOUP_STATUS_UNAUTHORIZED ||
@@ -1223,7 +1237,9 @@ book_backend_webdav_test_can_connect (EBookBackendWebdav *webdav,
g_return_val_if_fail (E_IS_BOOK_BACKEND_WEBDAV (webdav), FALSE);
/* Send a PROPFIND to test whether user/password is correct. */
- message = send_propfind (webdav, cancellable);
+ message = send_propfind (webdav, cancellable, error);
+ if (!message)
+ return FALSE;
switch (message->status_code) {
case SOUP_STATUS_OK:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]