summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2017-10-11 19:14:04 +0200
committerMilan Crha <mcrha@redhat.com>2017-10-11 19:14:04 +0200
commit01a01ef52c96c3f59c9ed9c0cd941a7f5805168a (patch)
tree1d837d67bc660c2ef6428052d7c8dd98b6f02c4f
parentfb15aca9e2ad16e1fa58d799191fffdf03fe1e7c (diff)
downloadevolution-data-server-01a01ef52c96c3f59c9ed9c0cd941a7f5805168a.tar.gz
Prevent crash when an On The Web calendar has set incorrect URI
There could happen a NULL dereference at ecb_http_webcal_to_http_method(). It had been reported downstream at: https://bugzilla.redhat.com/show_bug.cgi?id=1500663
-rw-r--r--src/calendar/backends/http/e-cal-backend-http.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/calendar/backends/http/e-cal-backend-http.c b/src/calendar/backends/http/e-cal-backend-http.c
index d97d06504..4f86c5c7d 100644
--- a/src/calendar/backends/http/e-cal-backend-http.c
+++ b/src/calendar/backends/http/e-cal-backend-http.c
@@ -85,6 +85,11 @@ ecb_http_dup_uri (ECalBackendHttp *cbhttp)
uri_string = soup_uri_to_string (soup_uri, FALSE);
soup_uri_free (soup_uri);
+ if (!uri_string || !*uri_string) {
+ g_free (uri_string);
+ return NULL;
+ }
+
uri = ecb_http_webcal_to_http_method (uri_string, secure_connection);
g_free (uri_string);