1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-27 18:50:07 +03:00

fuzz: Harden leak check in lint fuzzer

Check for undetected memory leaks from previous iterations. This also
makes sure that the maxmem limit is checked deterministically.
This commit is contained in:
Nick Wellnhofer 2024-12-13 15:23:30 +01:00
parent c6c6d8afef
commit 44628d4559

View File

@ -131,6 +131,11 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
unsigned uval;
int ival;
if (xmlMemUsed() != 0) {
fprintf(stderr, "Undetected leak in previous iteration\n");
abort();
}
vars.argv = malloc((numSwitches + 5 + 6 * 2) * sizeof(vars.argv[0]));
vars.argi = 0;
pushArg("xmllint"),