]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/fuzz/fuzz-journald.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include "alloc-util.h"
4 #include "fuzz-journald.h"
5 #include "journald-server.h"
8 void fuzz_journald_processing_function(
11 void (*f
)(Server
*s
, const char *buf
, size_t raw_len
, const struct ucred
*ucred
, const struct timeval
*tv
, const char *label
, size_t label_len
)
16 struct ucred
*ucred
= NULL
;
17 struct timeval
*tv
= NULL
;
22 assert_se(sd_event_default(&s
.event
) >= 0);
23 s
.syslog_fd
= s
.native_fd
= s
.stdout_fd
= s
.dev_kmsg_fd
= s
.audit_fd
= s
.hostname_fd
= s
.notify_fd
= -1;
24 s
.buffer
= memdup_suffix0(data
, size
);
26 s
.buffer_size
= size
+ 1;
27 s
.storage
= STORAGE_NONE
;
28 (*f
)(&s
, s
.buffer
, size
, ucred
, tv
, label
, label_len
);