summaryrefslogtreecommitdiff
path: root/src/fuzz
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-17 11:42:55 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-31 14:30:23 +0200
commitbbdad08530f3b989e94fe0dc21103be5ae68fe9d (patch)
tree84ae70f028f63c070b2457d07abcc29b685f4de7 /src/fuzz
parentcca24fc3e60680861b1783dd54e80da7d16db347 (diff)
downloadsystemd-bbdad08530f3b989e94fe0dc21103be5ae68fe9d.tar.gz
fuzz-journal-remote: try all output modes
Diffstat (limited to 'src/fuzz')
-rw-r--r--src/fuzz/fuzz-journal-remote.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/fuzz/fuzz-journal-remote.c b/src/fuzz/fuzz-journal-remote.c
index 3f6ed33571..915e88c283 100644
--- a/src/fuzz/fuzz-journal-remote.c
+++ b/src/fuzz/fuzz-journal-remote.c
@@ -21,6 +21,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int fdin; /* will be closed by journal_remote handler after EOF */
_cleanup_close_ int fdout = -1;
sd_journal *j;
+ OutputMode mode;
int r;
if (size <= 2)
@@ -52,8 +53,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
r = sd_journal_open_files(&j, (const char**) STRV_MAKE(name), 0);
assert_se(r >= 0);
- r = show_journal(stdout, j, OUTPUT_VERBOSE, 0, 0, -1, 0, NULL);
- assert_se(r >= 0);
+ for (mode = 0; mode < _OUTPUT_MODE_MAX; mode++) {
+ r = show_journal(stdout, j, mode, 0, 0, -1, 0, NULL);
+ assert_se(r >= 0);
+
+ r = sd_journal_seek_head(j);
+ assert_se(r >= 0);
+ }
sd_journal_close(j);
unlink(name);