This source file includes following definitions.
- LLVMFuzzerTestOneInput
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <stdint.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15
16 #include <crm/cib.h>
17
18 int
19 LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
20 {
21 char *filename = NULL;
22 int fd = 0;
23 cib_t *cib = NULL;
24
25
26 if (size < 5) {
27 return -1;
28 }
29
30 filename = pcmk__assert_alloc(size + 1, sizeof(char));
31 memcpy(filename, data, size);
32 filename[size] = '\0';
33
34 cib = cib_file_new(filename);
35
36 cib_delete(cib);
37 free(filename);
38 return 0;
39 }