1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Have the b-tree layer return SQLITE_CORRUPT to any attempt to open a cursor with a root page number less than 1.

FossilOrigin-Name: aa18c8e9d1676b1caa53bc5f5c1dc5f201089b88
This commit is contained in:
dan
2015-05-25 19:24:36 +00:00
parent 0f8076dd69
commit 08f901b008
4 changed files with 36 additions and 11 deletions

View File

@@ -3888,9 +3888,13 @@ int sqlite3BtreeCursor(
BtCursor *pCur /* Write new cursor here */
){
int rc;
sqlite3BtreeEnter(p);
rc = btreeCursor(p, iTable, wrFlag, pKeyInfo, pCur);
sqlite3BtreeLeave(p);
if( iTable<1 ){
rc = SQLITE_CORRUPT_BKPT;
}else{
sqlite3BtreeEnter(p);
rc = btreeCursor(p, iTable, wrFlag, pKeyInfo, pCur);
sqlite3BtreeLeave(p);
}
return rc;
}