mirror of
https://github.com/curl/curl.git
synced 2026-08-03 19:00:30 +03:00
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:
parent
4762995d1f
commit
a7846189cd
4 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue