aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2019-03-09 07:38:16 +0000
committerdan <dan@noemail.net>2019-03-09 07:38:16 +0000
commitf7b846e4ed54c7859d022d12cfaa6510dbb1ac28 (patch)
treeb2aa7275788355cf1e547ad08232f21d69301244 /src/btree.c
parent0d86a9bd54483ecce8dfd1b3fe34dd6e359406ab (diff)
parent37f6ffb88734c385aa9afc983678867057d09f20 (diff)
downloadsqlite-f7b846e4ed54c7859d022d12cfaa6510dbb1ac28.tar.gz
sqlite-f7b846e4ed54c7859d022d12cfaa6510dbb1ac28.zip
Merge latest trunk changes into this branch.
FossilOrigin-Name: 53ea550ce759ae4683bcf0ae3af655bfe04f85db70f74edee6bcab56d83bb041
Diffstat (limited to 'src/btree.c')
-rw-r--r--src/btree.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/btree.c b/src/btree.c
index d13339565..03451cf30 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -5552,7 +5552,7 @@ int sqlite3BtreeMovetoUnpacked(
sqlite3_free(pCellKey);
goto moveto_finish;
}
- c = xRecordCompare(nCell, pCellKey, pIdxKey);
+ c = sqlite3VdbeRecordCompare(nCell, pCellKey, pIdxKey);
sqlite3_free(pCellKey);
}
assert(
@@ -7152,8 +7152,9 @@ static int editPage(
int iCell = (iOld + pPg->aiOvfl[i]) - iNew;
if( iCell>=0 && iCell<nNew ){
pCellptr = &pPg->aCellIdx[iCell * 2];
- assert( nCell>=iCell );
- memmove(&pCellptr[2], pCellptr, (nCell - iCell) * 2);
+ if( nCell>iCell ){
+ memmove(&pCellptr[2], pCellptr, (nCell - iCell) * 2);
+ }
nCell++;
if( pageInsertArray(
pPg, pBegin, &pData, pCellptr,
@@ -9268,6 +9269,9 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){
assert( sqlite3BtreeHoldsMutex(p) );
assert( p->inTrans==TRANS_WRITE );
assert( iTable>=2 );
+ if( iTable>btreePagecount(pBt) ){
+ return SQLITE_CORRUPT_BKPT;
+ }
rc = btreeGetPage(pBt, (Pgno)iTable, &pPage, 0);
if( rc ) return rc;