1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05: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:
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

@ -7,6 +7,12 @@
Changelog Changelog
Daniel (30 May 2005)
- 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.
Daniel (24 May 2005) Daniel (24 May 2005)
- Andres Garcia provided a text mode patch for several test cases so that they - Andres Garcia provided a text mode patch for several test cases so that they
do text comparisions better on Windows (newline-wise). do text comparisions better on Windows (newline-wise).

View File

@ -360,7 +360,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
/* str_start is start of line within buf */ /* str_start is start of line within buf */
k->str_start = k->str; 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) { if (!k->end_ptr) {
/* Not a complete header line within buffer, append the data to /* 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 */ /* 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->hbufp += full_length;
k->hbuflen += full_length; k->hbuflen += full_length;
*k->hbufp = 0; *k->hbufp = 0;

View File

@ -32,4 +32,4 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
test231 test232 test228 test229 test233 test234 test235 test236 test520 \ test231 test232 test228 test229 test233 test234 test235 test236 test520 \
test237 test238 test239 test243 test245 test246 test247 test248 test249 \ test237 test238 test239 test243 test245 test246 test247 test248 test249 \
test250 test251 test252 test253 test254 test255 test521 test522 test523 \ test250 test251 test252 test253 test254 test255 test521 test522 test523 \
test256 test257 test258 test259 test260 test261 test256 test257 test258 test259 test260 test261 test262

BIN
tests/data/test262 Normal file

Binary file not shown.