Fix libpsl_load_dafsa_fuzzer for libc6 < 2.22

This commit is contained in:
Tim Rühsen 2017-06-14 09:07:54 +02:00
parent d686c1fff7
commit 6ca1304bd4
1 changed files with 4 additions and 2 deletions

View File

@ -59,11 +59,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
// non-DAFSA load
fp = fmemopen(in + 16, size, "r");
assert(fp != NULL);
if (!fp && size) // libc6 < 2.22 return NULL when size == 0
assert(1);
psl = psl_load_fp(fp);
psl_free(psl);
fclose(fp);
if (fp)
fclose(fp);
psl = psl_latest(NULL);
psl_free(psl);