mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
fuzz-systemctl-parse-argv: call static destuctors
With all the preparatory work in previous PRs, we can now call static destructors repeatedly without issue. We need to do it here so that global variables allocated during parsing are properly freed.
This commit is contained in:
parent
36556f6e51
commit
425ac7a253
@ -6,6 +6,8 @@
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fuzz.h"
|
||||
#include "selinux-util.h"
|
||||
#include "static-destruct.h"
|
||||
#include "stdio-util.h"
|
||||
#include "strv.h"
|
||||
#include "systemctl.h"
|
||||
@ -57,5 +59,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
|
||||
release_busses(); /* We open the bus for communication with logind.
|
||||
* It needs to be closed to avoid apparent leaks. */
|
||||
|
||||
mac_selinux_finish();
|
||||
|
||||
/* Call static destructors to do global state cleanup. We do it here, and not in fuzz-main.c so that
|
||||
* any global state is destoyed between fuzzer runs. */
|
||||
static_destruct();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
BIN
test/fuzz/fuzz-systemctl-parse-argv/missing-strv-free.input
Normal file
BIN
test/fuzz/fuzz-systemctl-parse-argv/missing-strv-free.input
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user