diff options
author | drh <drh@noemail.net> | 2015-04-22 13:16:46 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-04-22 13:16:46 +0000 |
commit | 0ba51089c8c97f1005faed9ca4b42cd149d0f36a (patch) | |
tree | 97c7833bed42b7b9ac71cf3974045f5506681df8 /tool/fuzzershell.c | |
parent | 3fb2cc1173bba37a35bff408de125056e2244e95 (diff) | |
download | sqlite-0ba51089c8c97f1005faed9ca4b42cd149d0f36a.tar.gz sqlite-0ba51089c8c97f1005faed9ca4b42cd149d0f36a.zip |
Improved filtering of input for fuzzershell for modes other than generic.
FossilOrigin-Name: 025e8370dde2918b66683f8d7fa9c7d23d03c9b4
Diffstat (limited to 'tool/fuzzershell.c')
-rw-r--r-- | tool/fuzzershell.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tool/fuzzershell.c b/tool/fuzzershell.c index c142a32c6..c13046050 100644 --- a/tool/fuzzershell.c +++ b/tool/fuzzershell.c @@ -351,6 +351,7 @@ int main(int argc, char **argv){ char *zSql; /* SQL to run */ char *zToFree = 0; /* Call sqlite3_free() on this afte running zSql */ int iMode = FZMODE_Generic; /* Operating mode */ + const char *zCkGlob = 0; /* Inputs must match this glob */ g.zArgv0 = argv[0]; @@ -392,12 +393,16 @@ int main(int argc, char **argv){ z = argv[++i]; if( strcmp(z,"generic")==0 ){ iMode = FZMODE_Printf; + zCkGlob = 0; }else if( strcmp(z, "glob")==0 ){ iMode = FZMODE_Glob; + zCkGlob = "'*','*'"; }else if( strcmp(z, "printf")==0 ){ iMode = FZMODE_Printf; + zCkGlob = "'*',*"; }else if( strcmp(z, "strftime")==0 ){ iMode = FZMODE_Strftime; + zCkGlob = "'*',*"; }else{ abendError("unknown --mode: %s", z); } @@ -487,7 +492,7 @@ 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 ){ + if( zCkGlob && sqlite3_strglob(zCkGlob,&zIn[i])!=0 ){ zIn[iNext] = cSaved; continue; } |