[evolution-data-server] Bug 732018 - [IMAPx] Crash due to passing set GError to glib-networking ][



commit a17c38cb89f454c1dde5b4cf6730b897a19f74b0
Author: Milan Crha <mcrha redhat com>
Date:   Mon Feb 23 15:18:54 2015 +0100

    Bug 732018 - [IMAPx] Crash due to passing set GError to glib-networking ][
    
    Add a workaround and claim an error on console, instead of let
    glib-networking crash the application.

 camel/providers/imapx/camel-imapx-input-stream.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-input-stream.c 
b/camel/providers/imapx/camel-imapx-input-stream.c
index 21819a0..6a0af1e 100644
--- a/camel/providers/imapx/camel-imapx-input-stream.c
+++ b/camel/providers/imapx/camel-imapx-input-stream.c
@@ -70,6 +70,11 @@ imapx_input_stream_fill (CamelIMAPXInputStream *is,
        base_stream = g_filter_input_stream_get_base_stream (
                G_FILTER_INPUT_STREAM (is));
 
+       if (error && *error) {
+               g_warning ("%s: Avoiding GIO call with a filled error '%s'", G_STRFUNC, (*error)->message);
+               error = NULL;
+       }
+
        left = is->priv->end - is->priv->ptr;
        memcpy (is->priv->buf, is->priv->ptr, left);
        is->priv->end = is->priv->buf + left;
@@ -136,6 +141,11 @@ imapx_input_stream_read (GInputStream *stream,
                memcpy (buffer, priv->ptr, max);
                priv->ptr += max;
        } else {
+               if (error && *error) {
+                       g_warning ("%s: Avoiding GIO call with a filled error '%s'", G_STRFUNC, 
(*error)->message);
+                       error = NULL;
+               }
+
                max = MIN (priv->literal, count);
                max = g_input_stream_read (
                        base_stream, buffer, max, cancellable, error);
@@ -202,6 +212,11 @@ imapx_input_stream_read_nonblocking (GPollableInputStream *pollable_stream,
 
        pollable_stream = G_POLLABLE_INPUT_STREAM (base_stream);
 
+       if (error && *error) {
+               g_warning ("%s: Avoiding GIO call with a filled error '%s'", G_STRFUNC, (*error)->message);
+               error = NULL;
+       }
+
        /* XXX The function takes a GCancellable but the class method
         *     does not.  Should be okay to pass NULL here since this
         *     is just a pass-through. */


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