1 #include <stdint.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include "http_parser.h"
5
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)6 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
7 {
8 static const http_parser_settings settings_null = {
9 .on_message_begin = 0
10 , .on_header_field = 0
11 ,.on_header_value = 0
12 ,.on_url = 0
13 ,.on_status = 0
14 ,.on_body = 0
15 ,.on_headers_complete = 0
16 ,.on_message_complete = 0
17 ,.on_chunk_header = 0
18 ,.on_chunk_complete = 0
19 };
20
21 http_parser parser;
22 http_parser_init(&parser, HTTP_BOTH);
23 http_parser_execute(&parser, &settings_null, (char*)data, size);
24
25 return 0;
26 }
27