Curl_pp_readresp: zero terminate line
authorDaniel Stenberg <daniel@haxx.se>
Sat, 21 Dec 2013 23:17:58 +0000 (00:17 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 21 Dec 2013 23:20:13 +0000 (00:20 +0100)
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>
lib/pingpong.c

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