2020-08-29 20:02:44 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-29 20:02:44 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <LibHTTP/HttpRequest.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
|
|
|
|
{
|
2020-12-19 13:38:33 -03:00
|
|
|
auto request_wrapper = HTTP::HttpRequest::from_raw_request(ReadonlyBytes { data, size });
|
2020-08-29 20:02:44 -03:00
|
|
|
if (!request_wrapper.has_value())
|
|
|
|
|
return 1;
|
|
|
|
|
|
2021-05-14 15:53:27 -03:00
|
|
|
auto& request = request_wrapper.value();
|
2021-02-23 16:42:32 -03:00
|
|
|
VERIFY(request.method() != HTTP::HttpRequest::Method::Invalid);
|
2020-08-29 20:02:44 -03:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|