Skip to content

Commit

Permalink
fuzz-journal-remote: try all output modes
Browse files Browse the repository at this point in the history
  • Loading branch information
keszybz committed May 17, 2018
1 parent 03bc01e commit b70d302
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/fuzz/fuzz-journal-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
void *mem;
int fdin, fdout, r;
sd_journal *j;
OutputMode mode;

if (size <= 2)
return 0;
Expand Down Expand Up @@ -46,8 +47,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);
Expand Down

0 comments on commit b70d302

Please sign in to comment.