1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Change the printf, strftime, and glob modes of fuzzershell so that they

reject all inputs that do not start with a string literal followed by a
comma.  This helps the fuzzer focus in on the kinds of behavior those modes
are intended to test.

FossilOrigin-Name: 1cceefa7c6585bca786fe9f7118f7beb829ad709
This commit is contained in:
drh
2015-04-22 11:16:34 +00:00
parent 318d38cf7e
commit 3fb2cc1173
3 changed files with 14 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C When\scompiling\sfor\sUAP,\slink\sagainst\sthe\snew\sminimal\sMSVC\sruntime. C Change\sthe\sprintf,\sstrftime,\sand\sglob\smodes\sof\sfuzzershell\sso\sthat\sthey\nreject\sall\sinputs\sthat\sdo\snot\sstart\swith\sa\sstring\sliteral\sfollowed\sby\sa\ncomma.\s\sThis\shelps\sthe\sfuzzer\sfocus\sin\son\sthe\skinds\sof\sbehavior\sthose\smodes\nare\sintended\sto\stest.
D 2015-04-22T01:33:53.959 D 2015-04-22T11:16:34.611
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in faaf75b89840659d74501bea269c7e33414761c1 F Makefile.in faaf75b89840659d74501bea269c7e33414761c1
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -1204,7 +1204,7 @@ F tool/diffdb.c 7524b1b5df217c20cd0431f6789851a4e0cb191b
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2 F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
F tool/fast_vacuum.c 5ba0d6f5963a0a63bdc42840f678bad75b2ebce1 F tool/fast_vacuum.c 5ba0d6f5963a0a63bdc42840f678bad75b2ebce1
F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/fuzzershell.c 00c12b1e95095f43980ae3cafb51938eda577fe2 F tool/fuzzershell.c f9aa24371ce48b3a1c215eb0a9668936a7b64896
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
@ -1252,7 +1252,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 623ddbdbf48d26dac58c593bcb9e7b184334ddfc P 2cb945116e7a5b78741b19839899826b539d5868
R 647b9c5f348c3c64b56250400a815823 R 71e4a500a938155e198d8a588c679f56
U mistachkin U drh
Z 2676785d203eabdaf7fb118930189562 Z e9086986aed5a59c4a7252a09fff7a6a

View File

@ -1 +1 @@
2cb945116e7a5b78741b19839899826b539d5868 1cceefa7c6585bca786fe9f7118f7beb829ad709

View File

@ -485,7 +485,12 @@ int main(int argc, char **argv){
} }
} }
for(iNext=i; iNext<nIn && strncmp(&zIn[iNext],"/****<",6)!=0; iNext++){} for(iNext=i; iNext<nIn && strncmp(&zIn[iNext],"/****<",6)!=0; iNext++){}
cSaved = zIn[iNext];
zIn[iNext] = 0;
if( iMode!=FZMODE_Generic && sqlite3_strglob("'*',*",&zIn[i])!=0 ){
zIn[iNext] = cSaved;
continue;
}
rc = sqlite3_open_v2( rc = sqlite3_open_v2(
"main.db", &db, "main.db", &db,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY,
@ -514,8 +519,6 @@ int main(int argc, char **argv){
if( zEncoding ) sqlexec(db, "PRAGMA encoding=%s", zEncoding); if( zEncoding ) sqlexec(db, "PRAGMA encoding=%s", zEncoding);
if( pageSize ) sqlexec(db, "PRAGMA pagesize=%d", pageSize); if( pageSize ) sqlexec(db, "PRAGMA pagesize=%d", pageSize);
if( doAutovac ) sqlexec(db, "PRAGMA auto_vacuum=FULL"); if( doAutovac ) sqlexec(db, "PRAGMA auto_vacuum=FULL");
cSaved = zIn[iNext];
zIn[iNext] = 0;
printf("INPUT (offset: %d, size: %d): [%s]\n", printf("INPUT (offset: %d, size: %d): [%s]\n",
i, (int)strlen(&zIn[i]), &zIn[i]); i, (int)strlen(&zIn[i]), &zIn[i]);
zSql = &zIn[i]; zSql = &zIn[i];