[evolution] handle_http_request: Skip invalid URIs
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] handle_http_request: Skip invalid URIs
- Date: Fri, 20 Feb 2015 13:31:45 +0000 (UTC)
commit 2f7e0badb456953779596dade2b239117fbcd81d
Author: Milan Crha <mcrha redhat com>
Date: Fri Feb 20 14:29:36 2015 +0100
handle_http_request: Skip invalid URIs
It wasn't checked whether the passed-in URI was correct, but the message
object returned from soup_message_new() was dereferenced anyway, which
could cause a crash.
mail/e-http-request.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index 39ceb56..afe09cf 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -361,6 +361,12 @@ handle_http_request (GSimpleAsyncResult *res,
GError *error;
GMainContext *context;
+ message = soup_message_new (SOUP_METHOD_GET, uri);
+ if (!message) {
+ g_debug ("%s: Skipping invalid URI '%s'", G_STRFUNC, uri);
+ goto cleanup;
+ }
+
context = g_main_context_new ();
g_main_context_push_thread_default (context);
@@ -372,7 +378,6 @@ handle_http_request (GSimpleAsyncResult *res,
temp_session, "proxy-resolver",
G_BINDING_SYNC_CREATE);
- message = soup_message_new (SOUP_METHOD_GET, uri);
soup_message_headers_append (
message->request_headers,
"User-Agent", "Evolution/" VERSION);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]