]> granicus.if.org Git - curl/commitdiff
Make Curl_pop3_write() additionally truncate trailing POP3_EOB from received
authorYang Tse <yangsita@gmail.com>
Sat, 30 Jan 2010 05:22:30 +0000 (05:22 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 30 Jan 2010 05:22:30 +0000 (05:22 +0000)
string buffer, otherwise Curl_client_write() call with zero size would write
to the end of string buffer including matched POP3_EOB.

lib/pop3.c

index bb3781ef37aa271c145b7fd8b519469fe04d1e99..f94035faad3450d87ad4c6bc337c6f87dc4ccf84 100644 (file)
@@ -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;