1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-10 11:35:07 -05:00

Curl_pp_readresp: zero terminate line

The comment in the code mentions the zero terminating after having
copied data, but it mistakingly zero terminated the source data and not
the destination! This caused the test 864 problem discussed on the list:

http://curl.haxx.se/mail/lib-2013-12/0113.html
Signed-off-by: Daniel Stenberg <daniel@haxx.se>
This commit is contained in:
Daniel Stenberg 2013-12-22 00:17:58 +01:00
parent ca4506b46a
commit bf468fb589

View File

@ -380,7 +380,7 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
int n; int n;
for(meow=pp->linestart_resp, n=0; meow<ptr; meow++, n++) for(meow=pp->linestart_resp, n=0; meow<ptr; meow++, n++)
buf[n] = *meow; buf[n] = *meow;
*meow=0; /* zero terminate */ buf[n]=0; /* zero terminate */
keepon=FALSE; keepon=FALSE;
pp->linestart_resp = ptr+1; /* advance pointer */ pp->linestart_resp = ptr+1; /* advance pointer */
i++; /* skip this before getting out */ i++; /* skip this before getting out */