summaryrefslogtreecommitdiffstats
path: root/src/fuzz
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-09-03 09:05:48 +0200
committerEvgeny Vereshchagin <evvers@ya.ru>2018-09-03 09:16:52 +0200
commit9cdea02db57a36442ad9e9afcd67760ca319173a (patch)
tree74fcb1330c3b82b026b484a893ae807b7353661d /src/fuzz
parentjournald: make server_process_native_message compatible with fuzz_journald_pr... (diff)
downloadsystemd-9cdea02db57a36442ad9e9afcd67760ca319173a.tar.xz
systemd-9cdea02db57a36442ad9e9afcd67760ca319173a.zip
tests: add a fuzzer for server_process_native_message
Diffstat (limited to 'src/fuzz')
-rw-r--r--src/fuzz/fuzz-journald-native.c10
-rw-r--r--src/fuzz/meson.build5
2 files changed, 15 insertions, 0 deletions
diff --git a/src/fuzz/fuzz-journald-native.c b/src/fuzz/fuzz-journald-native.c
new file mode 100644
index 0000000000..f4de5fd8eb
--- /dev/null
+++ b/src/fuzz/fuzz-journald-native.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+
+#include "fuzz.h"
+#include "fuzz-journald.h"
+#include "journald-native.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ fuzz_journald_processing_function(data, size, server_process_native_message);
+ return 0;
+}
diff --git a/src/fuzz/meson.build b/src/fuzz/meson.build
index 28770b68b8..5a97ef5091 100644
--- a/src/fuzz/meson.build
+++ b/src/fuzz/meson.build
@@ -19,6 +19,11 @@ fuzzers += [
libshared],
[libmount]],
+ [['src/fuzz/fuzz-journald-native.c'],
+ [libjournal_core,
+ libshared],
+ [libselinux]],
+
[['src/fuzz/fuzz-journald-syslog.c'],
[libjournal_core,
libshared],