mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Try fixing oss-fuzz running out of memory and skipping a lot
This commit is contained in:
+4
-6
@@ -43,9 +43,8 @@ func FuzzResponseReadLimitBody(f *testing.F) {
|
||||
f.Add([]byte("HTTP/1.1 200 OK\r\nContent-Type: aa\r\nContent-Length: 10\r\n\r\n9876543210"), 1024)
|
||||
|
||||
f.Fuzz(func(t *testing.T, body []byte, max int) {
|
||||
if max > 1024*1024 { // Skip limits higher than 1MB.
|
||||
return
|
||||
}
|
||||
// Don't do bodies bigger than 10kb.
|
||||
max = max % (10 * 1024)
|
||||
|
||||
var res Response
|
||||
|
||||
@@ -59,9 +58,8 @@ func FuzzRequestReadLimitBody(f *testing.F) {
|
||||
f.Add([]byte("POST /a HTTP/1.1\r\nHost: a.com\r\nTransfer-Encoding: chunked\r\nContent-Type: aa\r\n\r\n6\r\nfoobar\r\n3\r\nbaz\r\n0\r\nfoobar\r\n\r\n"), 1024)
|
||||
|
||||
f.Fuzz(func(t *testing.T, body []byte, max int) {
|
||||
if max > 1024*1024 { // Skip limits higher than 1MB.
|
||||
return
|
||||
}
|
||||
// Don't do bodies bigger than 10kb.
|
||||
max = max % (10 * 1024)
|
||||
|
||||
var req Request
|
||||
|
||||
|
||||
Reference in New Issue
Block a user