[evolution-data-server/gnome-3-22] [IMAPx] Avoid crash when untagged response doesn't have a token



commit 49ed77d2aac2512087a9c4e9cc0dbff504b2da21
Author: Milan Crha <mcrha redhat com>
Date:   Mon Oct 31 19:07:58 2016 +0100

    [IMAPx] Avoid crash when untagged response doesn't have a token
    
    Some server(s) can return untagged responses without tokens, like when
    moving messages the server(s) can return "* [COPYUID 15810658 ...."
    for "UID MOVE" request, which causes the crash.

 camel/providers/imapx/camel-imapx-server.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index fe4ebd7..4d48563 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -1959,8 +1959,10 @@ imapx_untagged (CamelIMAPXServer *is,
 
        e (is->priv->tagprefix, "Have token '%s' id %lu\n", is->priv->context->token, is->priv->context->id);
        p = is->priv->context->token;
-       while ((c = *p))
+       while (p && *p) {
+               c = *p;
                *p++ = g_ascii_toupper ((gchar) c);
+       }
 
        token = (const gchar *) is->priv->context->token; /* FIXME need 'guchar *token' here */
        while (token != NULL) {


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