aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2010-04-24 04:05:16 +0200
committerMatthias Andree <matthias.andree@gmx.de>2010-04-24 06:14:31 +0200
commitdb1d72d825c1eab2419befb797acfaf0a36a277b (patch)
tree79a99de395be95856358aab6f9623919e4427117
parent77f6d4c3bcb260881caeefb04eb2f3c2f2370052 (diff)
downloadfetchmail-db1d72d825c1eab2419befb797acfaf0a36a277b.tar.gz
fetchmail-db1d72d825c1eab2419befb797acfaf0a36a277b.tar.bz2
fetchmail-db1d72d825c1eab2419befb797acfaf0a36a277b.zip
Validate STAT response more strictly.
-rw-r--r--pop3.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pop3.c b/pop3.c
index 0cf58da7..b1f9621c 100644
--- a/pop3.c
+++ b/pop3.c
@@ -1009,9 +1009,13 @@ static int pop3_getrange(int sock,
/* get the total message count */
gen_send(sock, "STAT");
ok = pop3_ok(sock, buf);
- if (ok == 0)
- sscanf(buf,"%d %d", countp, bytes);
- else
+ if (ok == 0) {
+ int asgn;
+
+ asgn = sscanf(buf,"%d %d", countp, bytes);
+ if (asgn != 2)
+ return PS_PROTOCOL;
+ } else
return(ok);
/*