mirror of
https://github.com/curl/curl.git
synced 2024-12-09 06:30:06 +08:00
headers: handle unfold of space-cleansed headers
Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47767 Updated test 1274 Closes #8947
This commit is contained in:
parent
45de940ceb
commit
f810047f9d
@ -227,8 +227,8 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value,
|
||||
DEBUGASSERT(data->state.prevhead);
|
||||
hs = data->state.prevhead;
|
||||
olen = strlen(hs->value);
|
||||
oalloc = olen + strlen(hs->name) + 1;
|
||||
offset = hs->value - hs->buffer;
|
||||
oalloc = olen + offset + 1;
|
||||
|
||||
/* skip all trailing space letters */
|
||||
while(vlen && ISSPACE(value[vlen - 1]))
|
||||
|
@ -19,7 +19,8 @@ Server: test-server/
|
||||
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
ETag: "21025-dc7-39462498"
|
||||
Content-Length: 6
|
||||
Connection: close
|
||||
Connection:
|
||||
close
|
||||
|
||||
-foo-
|
||||
</data>
|
||||
@ -58,7 +59,8 @@ Server: test-server/
|
||||
Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
|
||||
ETag: "21025-dc7-39462498"
|
||||
Content-Length: 6
|
||||
Connection: close
|
||||
Connection:
|
||||
close
|
||||
|
||||
</file>
|
||||
</verify>
|
||||
|
Loading…
Reference in New Issue
Block a user