From e69274122db6f97b940b82df119afb165e295cf9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 15 Oct 1997 23:45:08 +0000 Subject: Wolfgang Wander's patches. svn path=/trunk/; revision=1516 --- pop3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pop3.c') 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; -- cgit v1.2.3