diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-16 08:48:37 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-16 08:57:12 +0100 |
commit | a16d732a51f93853f2595ead7c14632646610d75 (patch) | |
tree | 5bb3448f725ccf258867964dc21ed2a9e1935dfc /src/systemctl | |
parent | e557c82dd5867a790d37f0a165feb0570712516b (diff) | |
download | systemd-a16d732a51f93853f2595ead7c14632646610d75.tar.gz |
fuzz-systemctl-parse-argv: avoid "leak" of bus object
Memory sanitizer would report leaked memory from --boot-load-entry=help.
Maybe we should disable all bus connections from the fuzzer? It seems not
appropriate to communicate with logind. OTOH, in a real fuzzing environment
this call should just fail, so maybe that's OK.
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/fuzz-systemctl-parse-argv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systemctl/fuzz-systemctl-parse-argv.c b/src/systemctl/fuzz-systemctl-parse-argv.c index f884917e17..cf66fa4bb7 100644 --- a/src/systemctl/fuzz-systemctl-parse-argv.c +++ b/src/systemctl/fuzz-systemctl-parse-argv.c @@ -9,6 +9,7 @@ #include "stdio-util.h" #include "strv.h" #include "systemctl.h" +#include "systemctl-util.h" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { _cleanup_strv_free_ char **argv = NULL; @@ -54,5 +55,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { assert_se(freopen(path, "w", stdout)); } + release_busses(); /* We open the bus for communication with logind. + * It needs to be closed to avoid apparent leaks. */ return 0; } |