/src/tarantool/test/fuzz/datetime_strptime_fuzzer.cc
Line | Count | Source |
1 | | #include <fuzzer/FuzzedDataProvider.h> |
2 | | #include <stddef.h> |
3 | | |
4 | | #include "datetime.h" |
5 | | |
6 | | extern "C" void |
7 | 0 | cord_on_yield(void) {} |
8 | | |
9 | | extern "C" int |
10 | | LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
11 | 4.45k | { |
12 | 4.45k | FuzzedDataProvider fdp(data, size); |
13 | | |
14 | 4.45k | auto buf = fdp.ConsumeRandomLengthString(); |
15 | 4.45k | auto fmt = fdp.ConsumeRandomLengthString(); |
16 | | |
17 | 4.45k | struct datetime date_expected; |
18 | 4.45k | datetime_strptime(&date_expected, buf.c_str(), fmt.c_str()); |
19 | | |
20 | 4.45k | return 0; |
21 | 4.45k | } |