shared/specifier: be less extravagant with memory allocations
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Mar 2018 08:15:44 +0000 (10:15 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Mar 2018 08:38:45 +0000 (10:38 +0200)
commite2093454a248ff7d879077a77f4e9a086439d353
treea79dd8e551da243f8d37a32ac5f0f50426406729
parent27fe58b77b5ed322971c7d2ea17ead1518652919
shared/specifier: be less extravagant with memory allocations

ubsan times out because we do too many allocations:

$ valgrind build/fuzz-unit-file test/fuzz-regressions/fuzz-unit-file/oss-fuzz-6977-full
...
test/fuzz-regressions/fuzz-unit-file/oss-fuzz-6977-full... ok
==1757==
==1757== HEAP SUMMARY:
==1757==     in use at exit: 0 bytes in 0 blocks
==1757==   total heap usage: 199,997 allocs, 199,997 frees, 90,045,318,585 bytes allocated

...
==3256==   total heap usage: 100,120 allocs, 100,120 frees, 13,097,140 bytes allocated

https://oss-fuzz.com/v2/issue/4651449704251392/6977 should now be really fixed.

e3c3d6761b3e7d was the first attempt, but even with this change, e3c3d6761b3e7d
still makes sense.
src/shared/specifier.c
test/fuzz-regressions/fuzz-unit-file/oss-fuzz-6977-unminimized [new file with mode: 0644]