diff options
author | drh <drh@noemail.net> | 2019-01-29 02:37:22 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-01-29 02:37:22 +0000 |
commit | 4a7e9a25b64489a9d7e8f1d84f0e50cbbb4a7735 (patch) | |
tree | 3c7e97e0deecd9dd57f3a324636fc6129671b394 /test/ossfuzz.c | |
parent | 3967d946c7a1fe956e963b0a2e67a8353404a454 (diff) | |
download | sqlite-4a7e9a25b64489a9d7e8f1d84f0e50cbbb4a7735.tar.gz sqlite-4a7e9a25b64489a9d7e8f1d84f0e50cbbb4a7735.zip |
Set a low limit on the length of strings and blobs in the OSSFuzz module,
in an effort to avoid timeouts when the fuzzer does things like
"randomblob(1e12)".
FossilOrigin-Name: 119d1609fa415894fdd0aa19440ca1c658bd01910838a4cfadbe0e304b033bfd
Diffstat (limited to 'test/ossfuzz.c')
-rw-r--r-- | test/ossfuzz.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ossfuzz.c b/test/ossfuzz.c index c3d66eb29..3b1017f72 100644 --- a/test/ossfuzz.c +++ b/test/ossfuzz.c @@ -155,6 +155,11 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { /* Set a limit on the maximum size of a prepared statement */ sqlite3_limit(cx.db, SQLITE_LIMIT_VDBE_OP, 25000); + /* Set a limit on the maximum length of a string or BLOB. Without this + ** limit, fuzzers will invoke randomblob(N) for a large N, and the process + ** will timeout trying to generate the huge blob */ + sqlite3_limit(cx.db, SQLITE_LIMIT_LENGTH, 50000); + /* Bit 1 of the selector enables foreign key constraints */ sqlite3_db_config(cx.db, SQLITE_DBCONFIG_ENABLE_FKEY, uSelector&1, &rc); uSelector >>= 1; |