diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:40 +0000 |
commit | fc53809803cd2bc2434e312b19a18fa36776da12 (patch) | |
tree | b4b43bd6538f51965ce32856e9c053d0f90919c8 /src/systemctl/fuzz-systemctl-parse-argv.c | |
parent | Adding upstream version 255.5. (diff) | |
download | systemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip |
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/systemctl/fuzz-systemctl-parse-argv.c')
-rw-r--r-- | src/systemctl/fuzz-systemctl-parse-argv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/systemctl/fuzz-systemctl-parse-argv.c b/src/systemctl/fuzz-systemctl-parse-argv.c index 9ea8f7a..99cf6c2 100644 --- a/src/systemctl/fuzz-systemctl-parse-argv.c +++ b/src/systemctl/fuzz-systemctl-parse-argv.c @@ -49,7 +49,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { opterr = 0; /* do not print errors */ } + /* We need to reset some global state manually here since libfuzzer feeds a single process with + * multiple inputs, so we might carry over state from previous invocations that can trigger + * certain asserts. */ optind = 0; /* this tells the getopt machinery to reinitialize */ + arg_transport = BUS_TRANSPORT_LOCAL; r = systemctl_dispatch_parse_argv(strv_length(argv), argv); if (r < 0) |