aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-05-29 22:30:48 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-05-29 22:30:48 +0000
commita7846189cdb09a9d7ecca43f045cd0fb4517fe39 (patch)
tree5f632ac355ecf17962350a054a6d52b4d1d36bb4 /lib/transfer.c
parent4762995d1f8eb79986f777e812c3b0324a7c11d3 (diff)
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.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 3c1b52a21..fdc825bd2 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -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;