libreoffice-online/fuzzer/HttpResponse.cpp
Miklos Vajna e4298ccf31 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
2023-02-28 10:18:41 +01:00

17 lines
367 B
C++

#include <iostream>
#include "config.h"
#include <net/HttpRequest.hpp>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
for (size_t i = 0; i < size; ++i)
{
http::Response response;
response.readData(reinterpret_cast<const char*>(data), i);
}
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */