fluent-bit: deploy simple fuzz hook in build (#6075)

Signed-off-by: David Korczynski <david@adalogics.com>
This commit is contained in:
DavidKorczynski 2021-07-20 18:02:21 +01:00 committed by GitHub
parent 0a398c892b
commit cdeb7f2282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,11 @@
# limitations under the License.
#
################################################################################
cd fluent-bit/build
cd fluent-bit
sed -i 's/malloc(/fuzz_malloc(/g' ./lib/msgpack-c/src/zone.c
sed -i 's/struct msgpack_zone_chunk {/void *fuzz_malloc(size_t size) {if (size > 0xa00000) return NULL;\nreturn malloc(size);}\nstruct msgpack_zone_chunk {/g' ./lib/msgpack-c/src/zone.c
cd build
export CFLAGS="$CFLAGS -fcommon -DFLB_TESTS_OSSFUZZ=ON"
export CXXFLAGS="$CXXFLAGS -fcommon -DFLB_TESTS_OSSFUZZ=ON"