From 8f5b92744702cb652cf9fe52aae7b0ca63a17337 Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Wed, 8 May 2024 09:57:57 +0200 Subject: [PATCH] Try to fix oss-fuzz low memory limit again --- fuzz_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fuzz_test.go b/fuzz_test.go index 532c052f99..ba1737a493 100644 --- a/fuzz_test.go +++ b/fuzz_test.go @@ -47,11 +47,10 @@ func FuzzResponseReadLimitBody(f *testing.F) { return } - var res Response + res := AcquireResponse() + defer ReleaseResponse(res) _ = res.ReadLimitBody(bufio.NewReader(bytes.NewReader(body)), max) - w := bytes.Buffer{} - _, _ = res.WriteTo(&w) }) } @@ -63,11 +62,10 @@ func FuzzRequestReadLimitBody(f *testing.F) { return } - var req Request + req := AcquireRequest() + defer ReleaseRequest(req) _ = req.ReadLimitBody(bufio.NewReader(bytes.NewReader(body)), max) - w := bytes.Buffer{} - _, _ = req.WriteTo(&w) }) }