diff options
author | danielk1977 <danielk1977@noemail.net> | 2008-09-08 09:06:18 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2008-09-08 09:06:18 +0000 |
commit | ff9b2e75b4c1b5cc7569f9862f22381a1e871c1f (patch) | |
tree | 5af5b534d62d067d7d4a1fde68b887699d0b9f4a /src | |
parent | 1c826650400bdc59f096820924921c3d70c61d6e (diff) | |
download | sqlite-ff9b2e75b4c1b5cc7569f9862f22381a1e871c1f.tar.gz sqlite-ff9b2e75b4c1b5cc7569f9862f22381a1e871c1f.zip |
If the 'rootpage' column of the sqlite_master table contains a NULL value, return SQLITE_CORRUPT to the caller. (CVS 5681)
FossilOrigin-Name: a7b7b126e9e9b0cd2d68643d8dff321cf41ce2ee
Diffstat (limited to 'src')
-rw-r--r-- | src/prepare.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/prepare.c b/src/prepare.c index b792b12f3..d6117941a 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -13,7 +13,7 @@ ** interface, and routines that contribute to loading the database schema ** from disk. ** -** $Id: prepare.c,v 1.96 2008/09/04 12:03:43 shane Exp $ +** $Id: prepare.c,v 1.97 2008/09/08 09:06:19 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -65,13 +65,11 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){ } assert( argc==3 ); + assert( iDb>=0 && iDb<db->nDb ); if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ if( argv[1]==0 ){ corruptSchema(pData, argv[0], 0); - return 1; - } - assert( iDb>=0 && iDb<db->nDb ); - if( argv[2] && argv[2][0] ){ + }else if( argv[2] && argv[2][0] ){ /* Call the parser to process a CREATE TABLE, INDEX or VIEW. ** But because db->init.busy is set to 1, no VDBE code is generated ** or executed. All the parser does is build the internal data |