aboutsummaryrefslogtreecommitdiff
path: root/tool/fuzzershell.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-04-22 11:16:34 +0000
committerdrh <drh@noemail.net>2015-04-22 11:16:34 +0000
commit3fb2cc1173bba37a35bff408de125056e2244e95 (patch)
tree4d15d54eccb7a9ab90cb571774caabf155590e47 /tool/fuzzershell.c
parent318d38cf7e16d0f47dc982c33e80792e06a6fff6 (diff)
downloadsqlite-3fb2cc1173bba37a35bff408de125056e2244e95.tar.gz
sqlite-3fb2cc1173bba37a35bff408de125056e2244e95.zip
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
Diffstat (limited to 'tool/fuzzershell.c')
-rw-r--r--tool/fuzzershell.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tool/fuzzershell.c b/tool/fuzzershell.c
index abdfd3ff0..c142a32c6 100644
--- a/tool/fuzzershell.c
+++ b/tool/fuzzershell.c
@@ -485,7 +485,12 @@ int main(int argc, char **argv){
}
}
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(
"main.db", &db,
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( pageSize ) sqlexec(db, "PRAGMA pagesize=%d", pageSize);
if( doAutovac ) sqlexec(db, "PRAGMA auto_vacuum=FULL");
- cSaved = zIn[iNext];
- zIn[iNext] = 0;
printf("INPUT (offset: %d, size: %d): [%s]\n",
i, (int)strlen(&zIn[i]), &zIn[i]);
zSql = &zIn[i];