From cdeb7f2282e283ab72c03bb2d5ae1e21f4b672b7 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Tue, 20 Jul 2021 18:02:21 +0100 Subject: [PATCH] fluent-bit: deploy simple fuzz hook in build (#6075) Signed-off-by: David Korczynski --- projects/fluent-bit/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/fluent-bit/build.sh b/projects/fluent-bit/build.sh index b0911c214..bf5aac315 100755 --- a/projects/fluent-bit/build.sh +++ b/projects/fluent-bit/build.sh @@ -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"