[evolution/webkit] Prevent crash when HTTP request fails



commit 2444efccd2ca69db35394d2a64a40a7e6fe91e99
Author: Dan VrÃtil <dvratil redhat com>
Date:   Tue Mar 27 18:14:14 2012 +0200

    Prevent crash when HTTP request fails

 mail/e-mail-request.c |    4 ++--
 mail/em-format-html.c |    1 -
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index 5357174..34f1845 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -367,7 +367,7 @@ handle_http_request (GSimpleAsyncResult *res,
 		GMainContext *context;
 		GError *error;
 
-		struct http_request_async_data data;
+		struct http_request_async_data data = { 0 };
 
 		context = g_main_context_get_thread_default ();
 		session = soup_session_async_new_with_options (
@@ -693,7 +693,7 @@ mail_request_send_finish (SoupRequest *request,
 	g_object_unref (result);
 
         /* Reset the stream before passing it back to webkit */
-	if (stream)
+	if (stream && G_IS_SEEKABLE (stream))
 		g_seekable_seek (G_SEEKABLE (stream), 0, G_SEEK_SET, NULL, NULL);
 	else /* We must always return something */
 		stream = g_memory_input_stream_new ();
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 5694b9b..c481693 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -854,7 +854,6 @@ efh_write_text_html (EMFormat *emf,
 
 	} else if (info->mode == EM_FORMAT_WRITE_MODE_PRINTING) {
 		GString *string;
-		CamelDataWrapper *dw;
 		GByteArray *ba;
 		gchar *pos;
 		GList *tags, *iter;



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