]>
Commit | Line | Data |
---|---|---|
a032b68d | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
6e866b33 MB |
2 | |
3 | #include "fuzz.h" | |
4 | #include "fuzz-journald.h" | |
5 | #include "journald-kmsg.h" | |
6 | ||
7 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |
8 | Server s; | |
9 | ||
10 | if (size == 0) | |
11 | return 0; | |
12 | ||
8b3d4ff0 MB |
13 | /* We don't want to fill the logs with assert warnings. |
14 | * Disable most logging if not running standalone */ | |
15 | if (!getenv("SYSTEMD_LOG_LEVEL")) | |
16 | log_set_max_level(LOG_CRIT); | |
17 | ||
6e866b33 MB |
18 | dummy_server_init(&s, data, size); |
19 | dev_kmsg_record(&s, s.buffer, size); | |
20 | server_done(&s); | |
21 | ||
22 | return 0; | |
23 | } |