aboutsummaryrefslogtreecommitdiff
path: root/tool/fuzzershell.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-11-14 17:25:57 +0000
committerdrh <drh@noemail.net>2016-11-14 17:25:57 +0000
commit55377b47174f456fc6bb93e1096435a0071d4ea1 (patch)
treed80399b0c9c81f3e657469c91e3b9f3c1563817f /tool/fuzzershell.c
parent2adb878b1fb7d02c4c247889dbd98c8bfbb96c49 (diff)
downloadsqlite-55377b47174f456fc6bb93e1096435a0071d4ea1.tar.gz
sqlite-55377b47174f456fc6bb93e1096435a0071d4ea1.zip
Fix the ossfuzz.c test module so that it does not segfault after a
"PRAGMA empty_result_callbacks=1;". Add the ossshell.c program for simple command-line testing of ossfuzz.c. FossilOrigin-Name: 6f2d43eca68175ed28abae3afa792095af906af2
Diffstat (limited to 'tool/fuzzershell.c')
-rw-r--r--tool/fuzzershell.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tool/fuzzershell.c b/tool/fuzzershell.c
index d19139d98..710e07024 100644
--- a/tool/fuzzershell.c
+++ b/tool/fuzzershell.c
@@ -195,12 +195,14 @@ static int execCallback(void *NotUsed, int argc, char **argv, char **colv){
int i;
static unsigned cnt = 0;
printf("ROW #%u:\n", ++cnt);
- for(i=0; i<argc; i++){
- printf(" %s=", colv[i]);
- if( argv[i] ){
- printf("[%s]\n", argv[i]);
- }else{
- printf("NULL\n");
+ if( argv ){
+ for(i=0; i<argc; i++){
+ printf(" %s=", colv[i]);
+ if( argv[i] ){
+ printf("[%s]\n", argv[i]);
+ }else{
+ printf("NULL\n");
+ }
}
}
fflush(stdout);