From: Yang Tse Date: Sat, 30 Jan 2010 05:22:30 +0000 (+0000) Subject: Make Curl_pop3_write() additionally truncate trailing POP3_EOB from received X-Git-Tag: curl-7_20_0~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=715e3a806f333320f3d8a1172d7f000db59edcf6;p=curl Make Curl_pop3_write() additionally truncate trailing POP3_EOB from received string buffer, otherwise Curl_client_write() call with zero size would write to the end of string buffer including matched POP3_EOB. --- diff --git a/lib/pop3.c b/lib/pop3.c index bb3781ef3..f94035faa 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -935,6 +935,7 @@ CURLcode Curl_pop3_write(struct connectdata *conn, pop3c->eob += check; if(pop3c->eob == POP3_EOB_LEN) { /* full match, the transfer is done! */ + str[nread - check] = '\0'; nread -= check; k->keepon &= ~KEEP_RECV; pop3c->eob = 0;