request_fuzzer.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #include <stdbool.h>
20 #include <stdint.h>
21 #include <string.h>
22 
23 #include <grpc/grpc.h>
24 #include <grpc/support/alloc.h>
25 
27 
28 bool squelch = true;
29 bool leak_check = true;
30 
31 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
34  grpc_init();
35  memset(&request, 0, sizeof(request));
43  grpc_shutdown();
44  return 0;
45 }
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
memset
return memset(p, 0, total)
grpc_http_parser_eof
grpc_error_handle grpc_http_parser_eof(grpc_http_parser *parser)
Definition: src/core/lib/http/parser.cc:457
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
Definition: request_fuzzer.cc:31
string.h
benchmark.request
request
Definition: benchmark.py:77
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
grpc_http_request_destroy
void grpc_http_request_destroy(grpc_http_request *request)
Definition: src/core/lib/http/parser.cc:422
asyncio_get_stats.parser
parser
Definition: asyncio_get_stats.py:34
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
grpc.h
GRPC_HTTP_REQUEST
@ GRPC_HTTP_REQUEST
Definition: src/core/lib/http/parser.h:65
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
grpc_http_parser_destroy
void grpc_http_parser_destroy(grpc_http_parser *)
Definition: src/core/lib/http/parser.cc:420
stdint.h
parser.h
grpc_slice_from_copied_buffer
GPRAPI grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t len)
Definition: slice/slice.cc:170
alloc.h
leak_check
bool leak_check
Definition: request_fuzzer.cc:29
grpc_http_parser_parse
grpc_error_handle grpc_http_parser_parse(grpc_http_parser *parser, const grpc_slice &slice, size_t *start_of_body)
Definition: src/core/lib/http/parser.cc:444
grpc_http_parser_init
void grpc_http_parser_init(grpc_http_parser *parser, grpc_http_type type, void *request_or_response)
Definition: src/core/lib/http/parser.cc:411
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
squelch
bool squelch
Definition: request_fuzzer.cc:28
grpc_http_parser
Definition: src/core/lib/http/parser.h:99
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_http_request
Definition: src/core/lib/http/parser.h:69


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:10