Debian Codegraph @

fuzz/fuzz_url.c

raw symbols SCIP
1 // Copyright 2007 - 2022, Alan Antonuk and the rabbitmq-c contributors.
2 // SPDX-License-Identifier: mit
3
4 #include <inttypes.h>
5 #include <stddef.h>
6 #include <stdint.h>
7 #include <stdlib.h>
8 #include <string.h>
9
10 #include <rabbitmq-c/amqp.h>
11
12 extern int LLVMFuzzerTestOneInput(const char *data, size_t size) {
13 // amqp_parse_url expects null-terminated string that it can modify,
14 // LLVMFuzzer expects that data will not be modified and won't necessarily
15 // null terminate the string, so do that here.
16 char* in = malloc(size + 1);
17 memcpy(in, data, size);
18 in[size] = '\0';
19
20 struct amqp_connection_info ci;
21 amqp_parse_url(in, &ci);
22 free(in);
23 return 0;
24 }