From: drh Date: Mon, 19 May 2003 23:55:30 +0000 (+0000) Subject: Fix segfault that occurs when opening a non-existing database in the shell X-Git-Tag: version-3.6.10~5082 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6e1d288a9f50f7b715b37c8ec96713f35b7fb39e;p=thirdparty%2Fsqlite.git Fix segfault that occurs when opening a non-existing database in the shell then immediately doing ".q". (CVS 986) FossilOrigin-Name: e8566cf5a381fa7655caacbc0fe95091e1137fea --- diff --git a/manifest b/manifest index 5531040e06..baf6b46a2c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Additional\sattach\stesting.\s\sI\snow\sbelieve\sthat\sticket\s#317\swas\sfixed\nby\scheck-in\s(981).\s(CVS\s985) -D 2003-05-17T19:23:52 +C Fix\ssegfault\sthat\soccurs\swhen\sopening\sa\snon-existing\sdatabase\sin\sthe\sshell\nthen\simmediately\sdoing\s".q".\s(CVS\s986) +D 2003-05-19T23:55:30 F Makefile.in 1ff85c27d4350c74118341024e8a4fb2a04a3a43 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -44,7 +44,7 @@ F src/pragma.c ec64704e61286948f39157617f1ce2f506dd1b74 F src/printf.c fc5fdef6e92ad205005263661fe9716f55a49f3e F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe F src/select.c 15d921308065c9320363af6f43c01d9f09ea7118 -F src/shell.c 2565cb32cd862024bcfd88400e05437636cf21a1 +F src/shell.c b63089a91d6584df06eaa2e53ea1150c68ab1e61 F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e F src/sqliteInt.h 3ba355793a1e0b891cfa414901759189c9287a18 @@ -165,7 +165,7 @@ F www/speed.tcl cb4c10a722614aea76d2c51f32ee43400d5951be F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 -P c8c823b068916711857fa67db10fb479999b55c2 -R bc3167929b77207fc599db40b8510a4e +P 24191373796b7fd6255ef9b70ce2344326308113 +R 0ad195f6ccdfb80921d558f2c3b71dfc U drh -Z 07eb60187b21aabbdcf71968529d48bd +Z 12c0806bd04cf1493cea64fc795aa255 diff --git a/manifest.uuid b/manifest.uuid index eeadd48e75..4c7e2fd6f1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -24191373796b7fd6255ef9b70ce2344326308113 \ No newline at end of file +e8566cf5a381fa7655caacbc0fe95091e1137fea \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 48e367c270..bd9a85080f 100644 --- a/src/shell.c +++ b/src/shell.c @@ -12,7 +12,7 @@ ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.79 2003/05/13 00:24:41 drh Exp $ +** $Id: shell.c,v 1.80 2003/05/19 23:55:30 drh Exp $ */ #include #include @@ -767,7 +767,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ }else if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){ - sqlite_close(p->db); + if( p->db ) sqlite_close(p->db); exit(0); }else