aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-02 06:10:22 +0800
committerDan Winship <danw@src.gnome.org>2000-07-02 06:10:22 +0800
commit00d1c1c3335a6d1d7cb342b77923b8869e6e631c (patch)
treea4ef46e64e70c0a9b9d8cb7e4d18e0190f7d5fa1
parent25e3c025f6d1ebfe39e3e3b68ad8c1a48883991c (diff)
downloadgsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.tar
gsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.tar.gz
gsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.tar.bz2
gsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.tar.lz
gsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.tar.xz
gsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.tar.zst
gsoc2013-evolution-00d1c1c3335a6d1d7cb342b77923b8869e6e631c.zip
fix the CAPA-parsing code to not get into an infinite loop.
* providers/pop3/camel-pop3-store.c (connect_to_server): fix the CAPA-parsing code to not get into an infinite loop. svn path=/trunk/; revision=3849
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/pop3/camel-pop3-store.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 90cac0d0ee..a8f4b721ca 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-01 Dan Winship <danw@helixcode.com>
+
+ * providers/pop3/camel-pop3-store.c (connect_to_server): fix the
+ CAPA-parsing code to not get into an infinite loop.
+
2000-07-01 Jeffrey Stedfast <fejj@helixcode.com>
* providers/imap/camel-imap-folder.c (imap_get_message): Fixed
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index bdfe8dd36e..636172bb94 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -292,9 +292,9 @@ connect_to_server (CamelService *service, gboolean real, CamelException *ex)
if (!strncmp (p, "IMPLEMENTATION ", 15)) {
store->implementation =
g_strndup (p + 15, len - 15);
- } else if (!strncmp (p, "TOP", len))
+ } else if (len == 3 && !strncmp (p, "TOP", 3))
store->supports_top = TRUE;
- else if (!strncmp (p, "UIDL", len))
+ else if (len == 4 && !strncmp (p, "UIDL", 4))
store->supports_uidl = TRUE;
else if (!strncmp (p, "LOGIN-DELAY ", 12))
store->login_delay = atoi (p + 12);
@@ -304,6 +304,8 @@ connect_to_server (CamelService *service, gboolean real, CamelException *ex)
store->expires = TRUE;
p += len;
+ if (*p)
+ p++;
}
g_free (buf);