aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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;