diff options
author | Milan Crha <mcrha@redhat.com> | 2012-11-13 20:36:08 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-11-13 20:37:10 +0800 |
commit | e9038ba92372c11515ba5663c2fd41af7b8494a9 (patch) | |
tree | 230901699d338ae04f5280d1301fcf93c4da6235 /mail | |
parent | 37296f4aad57336e5d00e83f7ba9bea65a0394ee (diff) | |
download | gsoc2013-evolution-e9038ba92372c11515ba5663c2fd41af7b8494a9.tar.gz gsoc2013-evolution-e9038ba92372c11515ba5663c2fd41af7b8494a9.tar.zst gsoc2013-evolution-e9038ba92372c11515ba5663c2fd41af7b8494a9.zip |
Relative URI can crash Evolution in http_request_send_async()
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-http-request.c | 8 | ||||
-rw-r--r-- | mail/e-mail-display.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/mail/e-http-request.c b/mail/e-http-request.c index 84b243ba7e..4b77950a4c 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -168,7 +168,9 @@ handle_http_request (GSimpleAsyncResult *res, /* Remove the __evo-mail query */ soup_uri = soup_request_get_uri (SOUP_REQUEST (request)); - query = soup_form_decode (soup_uri->query); + g_return_if_fail (soup_uri_get_query (soup_uri) != NULL); + + query = soup_form_decode (soup_uri_get_query (soup_uri)); mail_uri = g_hash_table_lookup (query, "__evo-mail"); if (mail_uri) mail_uri = g_strdup (mail_uri); @@ -432,7 +434,9 @@ http_request_send_async (SoupRequest *request, ehr = E_HTTP_REQUEST (request); uri = soup_request_get_uri (request); - query = soup_form_decode (uri->query); + g_return_if_fail (soup_uri_get_query (uri) != NULL); + + query = soup_form_decode (soup_uri_get_query (uri)); d ({ gchar *uri_str = soup_uri_to_string (uri, FALSE); diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 5e33ccd570..a5445186cb 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -355,7 +355,8 @@ mail_display_resource_requested (WebKitWebView *web_view, /* Redirect http(s) request to evo-http(s) protocol. * See EMailRequest for further details about this. */ - } else if (g_str_has_prefix (uri, "http:") || g_str_has_prefix (uri, "https")) { + } else if (g_str_has_prefix (uri, "http:") || g_str_has_prefix (uri, "https:") || + g_str_has_prefix (uri, "evo-http:") || g_str_has_prefix (uri, "evo-https:")) { gchar *new_uri, *mail_uri, *enc; SoupURI *soup_uri; GHashTable *query; |