]>
git.proxmox.com Git - systemd.git/blob - src/fuzz/fuzz-time-util.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include "alloc-util.h"
9 int LLVMFuzzerTestOneInput(const uint8_t *data
, size_t size
) {
10 _cleanup_free_
char *str
= NULL
;
13 if (!getenv("SYSTEMD_LOG_LEVEL"))
14 log_set_max_level(LOG_CRIT
);
16 str
= memdup_suffix0(data
, size
);
18 (void) parse_timestamp(str
, &usec
);
19 (void) parse_sec(str
, &usec
);
20 (void) parse_sec_fix_0(str
, &usec
);
21 (void) parse_sec_def_infinity(str
, &usec
);
22 (void) parse_time(str
, &usec
, USEC_PER_SEC
);
23 (void) parse_nsec(str
, &usec
);
25 (void) timezone_is_valid(str
, LOG_DEBUG
);