mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2026-01-26 21:41:34 +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:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user