mirror of
https://github.com/curl/curl.git
synced 2026-08-24 20:23:40 +03:00
progress: count amount of data "delivered" to application
... and apply the CURLOPT_MAXFILESIZE limit (if set) on that as well. This effectively protects the user against "zip bombs". Test case 1618 verifies using a 14 byte brotli payload that otherwise explodes to 102400 zero bytes.
This commit is contained in:
parent
4b583b7585
commit
d332b9057f
10 changed files with 115 additions and 7 deletions
|
|
@ -213,7 +213,7 @@ test1580 test1581 test1582 test1583 test1584 test1585 \
|
|||
test1590 test1591 test1592 test1593 test1594 test1595 test1596 test1597 \
|
||||
test1598 test1599 test1600 test1601 test1602 test1603 test1604 test1605 \
|
||||
test1606 test1607 test1608 test1609 test1610 test1611 test1612 test1613 \
|
||||
test1614 test1615 test1616 test1617 \
|
||||
test1614 test1615 test1616 test1617 test1618 \
|
||||
test1620 test1621 test1622 test1623 \
|
||||
\
|
||||
test1630 test1631 test1632 test1633 test1634 test1635 test1636 test1637 \
|
||||
|
|
|
|||
68
tests/data/test1618
Normal file
68
tests/data/test1618
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
HTTP
|
||||
HTTP GET
|
||||
compressed
|
||||
brotli
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
<reply>
|
||||
|
||||
<data crlf="headers" nonewline="yes">
|
||||
HTTP/1.1 200 OK
|
||||
Date: Mon, 29 Nov 2004 21:56:53 GMT
|
||||
Vary: Accept-Encoding
|
||||
Content-Encoding: br
|
||||
Content-Length: 14
|
||||
|
||||
%hex[%81%fa%7f%0c%fc%13%00%f1%58%20%90%7b%18%00]hex%
|
||||
</data>
|
||||
|
||||
<datacheck crlf="headers">
|
||||
HTTP/1.1 200 OK
|
||||
Date: Mon, 29 Nov 2004 21:56:53 GMT
|
||||
Vary: Accept-Encoding
|
||||
Content-Encoding: br
|
||||
Content-Length: 14
|
||||
|
||||
</datacheck>
|
||||
|
||||
</reply>
|
||||
|
||||
# Client-side
|
||||
<client>
|
||||
<features>
|
||||
brotli
|
||||
</features>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
HTTP GET brotli compression bomb
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER --compressed --max-filesize=1000
|
||||
</command>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<strippart>
|
||||
s/^Accept-Encoding: [a-zA-Z, ]*/Accept-Encoding: xxx/
|
||||
</strippart>
|
||||
<protocol crlf="headers">
|
||||
GET /%TESTNUMBER HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
User-Agent: curl/%VERSION
|
||||
Accept: */*
|
||||
Accept-Encoding: xxx
|
||||
|
||||
</protocol>
|
||||
<errorcode>
|
||||
63
|
||||
</errorcode>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue