aboutsummaryrefslogtreecommitdiff
path: root/src/btree.c
diff options
context:
space:
mode:
authordrh <>2022-10-10 12:02:53 +0000
committerdrh <>2022-10-10 12:02:53 +0000
commit005c9d829593365b734d2885ddfe04ab85ffbc4f (patch)
tree2517a26a06745c87c325ef28003b2fd9f0fa2620 /src/btree.c
parent211a1a7281a6855b5a73fb6a6d3e74144845dc5f (diff)
downloadsqlite-005c9d829593365b734d2885ddfe04ab85ffbc4f.tar.gz
sqlite-005c9d829593365b734d2885ddfe04ab85ffbc4f.zip
Improved detection of database corrupting when moving pages on an
autovacuumed database when creating a new btree. dbsqlfuzz 9a55397eae13cec64aebf1fd35489c3a90bdaac5 FossilOrigin-Name: 327965bc71023d9380a9d6805062659108dab4bfcd386b7aba813754f270d33a
Diffstat (limited to 'src/btree.c')
-rw-r--r--src/btree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/btree.c b/src/btree.c
index c54fd2e7c..1c48d6e8c 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -3743,6 +3743,9 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){
}
}
}else{
+ if( pCell+4 > pPage->aData+pPage->pBt->usableSize ){
+ return SQLITE_CORRUPT_PAGE(pPage);
+ }
if( get4byte(pCell)==iFrom ){
put4byte(pCell, iTo);
break;