fuuzer, httpresponse: clear state before each run

The max input size is 16384, so in case the input is saved after each
run, then this can allocate ~300MB of memory. This is considerable
amount, given that the upper limit of the fuzzer process is 2GB.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ieedb6a537d5b539255ed8bacd79ff23db3c15e9f
pull/5925/head
Miklos Vajna 2023-02-27 09:12:39 +01:00 committed by Andras Timar
parent c05c2692ab
commit e4298ccf31
1 changed files with 3 additions and 1 deletions

View File

@ -6,9 +6,11 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
http::Response response;
for (size_t i = 0; i < size; ++i)
{
http::Response response;
response.readData(reinterpret_cast<const char*>(data), i);
}
return 0;
}