From bb643eaa60e6de1c1e18dba5c324dc3fce0e6909 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Fri, 11 Nov 2016 16:35:11 +0100 Subject: [PATCH] [sqlite] Limit max length of data blobs and sql queries to prevent OOMs. --- targets/sqlite3/build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/targets/sqlite3/build.sh b/targets/sqlite3/build.sh index e1123a07f..412476f48 100755 --- a/targets/sqlite3/build.sh +++ b/targets/sqlite3/build.sh @@ -21,6 +21,9 @@ mkdir bld cd bld export ASAN_OPTIONS=detect_leaks=0 +# Limit max length of data blobs and sql queries to prevent irrelevant OOMs. +export CFLAGS="$CFLAGS -DSQLITE_MAX_LENGTH=128000000 \ + -DSQLITE_MAX_SQL_LENGTH=128000000" ../configure make -j$(nproc) make sqlite3.c @@ -29,4 +32,4 @@ $CXX $CXXFLAGS -std=c++11 -I. \ /src/sqlite3_fuzzer.cc -o /out/sqlite3_fuzzer \ -lfuzzer ./sqlite3.o $FUZZER_LDFLAGS -cp /src/*.options /src/*.dict /out/ \ No newline at end of file +cp /src/*.options /src/*.dict /out/