]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/fuzz/fuzz-hostname-util.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 #include "alloc-util.h"
7 #include "hostname-util.h"
9 int LLVMFuzzerTestOneInput(const uint8_t *data
, size_t size
) {
10 _cleanup_fclose_
FILE *f
= NULL
;
11 _cleanup_free_
char *ret
= NULL
;
16 f
= fmemopen_unlocked((char*) data
, size
, "re");
19 /* We don't want to fill the logs with messages about parse errors.
20 * Disable most logging if not running standalone */
21 if (!getenv("SYSTEMD_LOG_LEVEL"))
22 log_set_max_level(LOG_CRIT
);
24 (void) read_etc_hostname_stream(f
, &ret
);