| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
|
| 3 |
#include "alloc-util.h" |
| 4 |
#include "fuzz.h" |
| 5 |
#include "time-util.h" |
| 6 |
|
| 7 |
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
| 8 |
_cleanup_free_ char *str = NULL; |
| 9 |
usec_t usec; |
| 10 |
|
| 11 |
fuzz_setup_logging(); |
| 12 |
|
| 13 |
assert_se(str = memdup_suffix0(data, size)); |
| 14 |
|
| 15 |
(void) parse_timestamp(str, &usec); |
| 16 |
(void) parse_sec(str, &usec); |
| 17 |
(void) parse_sec_fix_0(str, &usec); |
| 18 |
(void) parse_sec_def_infinity(str, &usec); |
| 19 |
(void) parse_time(str, &usec, USEC_PER_SEC); |
| 20 |
(void) parse_nsec(str, &usec); |
| 21 |
|
| 22 |
(void) timezone_is_valid(str, LOG_DEBUG); |
| 23 |
|
| 24 |
return 0; |
| 25 |
} |