[Git][slirp/libslirp][master] fuzz: Fix memory leak inside fuzz-main
Samuel Thibault (@sthibaul)
gitlab at gitlab.freedesktop.org
Tue Oct 1 12:02:41 UTC 2024
Samuel Thibault pushed to branch master at slirp / libslirp
Commits:
8e9e1172 by Alexander Kuznetsov at 2024-10-01T14:02:24+02:00
fuzz: Fix memory leak inside fuzz-main
Found by ALT Linux Team.
Signed-off-by: Alexander Kuznetsov <kuznetsovam at altlinux.org>
Fixes #80
- - - - -
2 changed files:
- fuzzing/README.md
- fuzzing/fuzz-main.c
Changes:
=====================================
fuzzing/README.md
=====================================
@@ -3,7 +3,7 @@
## Current state
We chose to use libFuzzer because of its custom mutator feature, which allows to keep coherent informations inside the packets being sent to libslirp. This ease the process of fuzzing as packets are less likely to be rejected early during processing them.
-In the current state, the `meson.build` file is not compatible with the original one used by libSlirp main repository but it should be easy to merge them in a clean way. Also **in the current state, it seems that there is a memory leak inside the fuzzing code**, which make it run out of memory. The current goal is to find and get rid of this leak to allow fuzzing for longer without the process being interrupted because of it.
+In the current state, the `meson.build` file is not compatible with the original one used by libSlirp main repository but it should be easy to merge them in a clean way.
Six harness are currently available, more are to be added later to focus on other parts of the code :
=====================================
fuzzing/fuzz-main.c
=====================================
@@ -25,6 +25,7 @@ int main(int argc, char **argv)
g_print("%s...\n", name);
for (j = 0; j < MIN_NUMBER_OF_RUNS; j++) {
if (LLVMFuzzerTestOneInput((void *)buf, size) == EXIT_TEST_SKIP) {
+ g_free(buf);
return EXIT_TEST_SKIP;
}
}
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/8e9e1172d0d6a0d6f54bd67c11f7115277294bbc
--
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/commit/8e9e1172d0d6a0d6f54bd67c11f7115277294bbc
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20241001/1016c9ba/attachment-0001.htm>
More information about the Slirp
mailing list