mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Prevent the fuzzer from ever returning a string longer than 100 bytes.
FossilOrigin-Name: 969095ca3067d60f4d3a0a4ad419541cb8b146db
This commit is contained in:
@ -28,8 +28,7 @@ do_test 1-pre1 {
|
||||
}
|
||||
faultsim_save_and_close
|
||||
} {}
|
||||
|
||||
do_faultsim_test 1 -faults oom-t* -prep {
|
||||
do_faultsim_test 1 -prep {
|
||||
faultsim_restore_and_reopen
|
||||
register_fuzzer_module db
|
||||
} -body {
|
||||
@ -42,6 +41,52 @@ do_faultsim_test 1 -faults oom-t* -prep {
|
||||
{1 {vtable constructor failed: x1}}
|
||||
}
|
||||
|
||||
do_test 2-pre1 {
|
||||
faultsim_delete_and_reopen
|
||||
register_fuzzer_module db
|
||||
execsql {
|
||||
CREATE TABLE x2_rules(ruleset, cFrom, cTo, cost);
|
||||
INSERT INTO x2_rules VALUES(0, 'a', 'x', 1);
|
||||
INSERT INTO x2_rules VALUES(0, 'b', 'x', 2);
|
||||
INSERT INTO x2_rules VALUES(0, 'c', 'x', 3);
|
||||
CREATE VIRTUAL TABLE x2 USING fuzzer(x2_rules);
|
||||
}
|
||||
faultsim_save_and_close
|
||||
} {}
|
||||
|
||||
do_faultsim_test 2 -prep {
|
||||
faultsim_restore_and_reopen
|
||||
register_fuzzer_module db
|
||||
} -body {
|
||||
execsql {
|
||||
SELECT count(*) FROM x2 WHERE word MATCH 'abc';
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 8} {1 {vtable constructor failed: x2}}
|
||||
}
|
||||
|
||||
do_test 3-pre1 {
|
||||
faultsim_delete_and_reopen
|
||||
execsql {
|
||||
CREATE TABLE x1_rules(ruleset, cFrom, cTo, cost);
|
||||
INSERT INTO x1_rules VALUES(0, 'a',
|
||||
'123456789012345678901234567890a1234567890123456789', 10
|
||||
);
|
||||
}
|
||||
faultsim_save_and_close
|
||||
} {}
|
||||
|
||||
do_faultsim_test 3 -prep {
|
||||
faultsim_restore_and_reopen
|
||||
register_fuzzer_module db
|
||||
} -body {
|
||||
execsql {
|
||||
CREATE VIRTUAL TABLE x1 USING fuzzer(x1_rules);
|
||||
SELECT count(*) FROM (SELECT * FROM x1 WHERE word MATCH 'a' LIMIT 2);
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 2} {1 {vtable constructor failed: x1}}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user