aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-10-15 23:45:08 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-10-15 23:45:08 +0000
commite69274122db6f97b940b82df119afb165e295cf9 (patch)
tree73ad8769a0b644bf12ecebbb4125cd6336a7b41b /pop3.c
parentb9396f9d9f0c288376197d7c0d2bea343236f539 (diff)
downloadfetchmail-e69274122db6f97b940b82df119afb165e295cf9.tar.gz
fetchmail-e69274122db6f97b940b82df119afb165e295cf9.tar.bz2
fetchmail-e69274122db6f97b940b82df119afb165e295cf9.zip
Wolfgang Wander's patches.
svn path=/trunk/; revision=1516
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pop3.c b/pop3.c
index 9fda2861..0cdf3179 100644
--- a/pop3.c
+++ b/pop3.c
@@ -243,6 +243,8 @@ pop3_gettopid( int sock, int num , char *id)
break;
if( ! got_it && ! strncasecmp("Message-Id:", buf, 11 )) {
got_it = 1;
+ /* prevent stack overflows */
+ buf[IDLEN+12] = 0;
sscanf( buf+12, "%s", id);
}
}
@@ -284,7 +286,7 @@ pop3_slowuidl( int sock, struct query *ctl, int *countp, int *newp)
if( (ok = pop3_gettopid( sock, try_id, id )) != 0 )
return ok;
- try_nr = str_nr_in_list(&ctl->oldsaved, id);
+ try_nr = str_nr_last_in_list(&ctl->oldsaved, id);
} else {
try_id = *countp+1;
try_nr = -1;