Eric Cooper reported about a problem with HTTP servers that responds with

binary zeroes within the headers. They confused libcurl to do wrong so the
downloaded headers become incomplete. The fix is now verified with test case
262.
This commit is contained in:
Daniel Stenberg
2005-05-29 22:30:48 +00:00
parent 4762995d1f
commit a7846189cd
4 changed files with 9 additions and 3 deletions

View File

@@ -360,7 +360,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
/* str_start is start of line within buf */
k->str_start = k->str;
k->end_ptr = strchr (k->str_start, '\n');
k->end_ptr = memchr(k->str_start, '\n', nread);
if (!k->end_ptr) {
/* Not a complete header line within buffer, append the data to
@@ -428,7 +428,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
}
/* copy to end of line */
strncpy (k->hbufp, k->str_start, full_length);
memcpy(k->hbufp, k->str_start, full_length);
k->hbufp += full_length;
k->hbuflen += full_length;
*k->hbufp = 0;