aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-10-25 13:42:10 +0000
committerdrh <>2022-10-25 13:42:10 +0000
commitd5ca2c4b3d2550c7e0b6689a6d5ebe9b4b279d06 (patch)
tree871fbcc5018fe688e0259bba21e5d22d8c50a1ec /src
parent89954fe7ce03f4337ce8935a4b44edabd91278d0 (diff)
downloadsqlite-d5ca2c4b3d2550c7e0b6689a6d5ebe9b4b279d06.tar.gz
sqlite-d5ca2c4b3d2550c7e0b6689a6d5ebe9b4b279d06.zip
Make the ".dump" command of the CLI more robust against malformed databases.
See [forum:/forumpost/730b554179|forum post 730b554179]. FossilOrigin-Name: 0573edfb9e0b1fd51e8da20592c71b02040968c33fdec41c31a6b1b7d3e83262
Diffstat (limited to 'src')
-rw-r--r--src/shell.c.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shell.c.in b/src/shell.c.in
index 21f610240..681f4847c 100644
--- a/src/shell.c.in
+++ b/src/shell.c.in
@@ -4161,6 +4161,8 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){
zTable = azArg[0];
zType = azArg[1];
zSql = azArg[2];
+ if( zTable==0 ) return 0;
+ if( zType==0 ) return 0;
dataOnly = (p->shellFlgs & SHFLG_DumpDataOnly)!=0;
noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0;