Improved detection of database corrupting when moving pages on an

autovacuumed database when creating a new btree.
dbsqlfuzz 9a55397eae13cec64aebf1fd35489c3a90bdaac5

FossilOrigin-Name: 327965bc71023d9380a9d6805062659108dab4bfcd386b7aba813754f270d33a
This commit is contained in:
drh 2022-10-10 12:02:53 +00:00
parent 211a1a7281
commit 005c9d8295
3 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C When\scasting\san\sodd-length\sBLOB\sinto\sa\sTEXT\swith\sencoding\sUTF16,\somit\sthe\nlast\sbyte.\s\sdbsqlfuzz\sc5df68b5bbdf6c9f3c1851e41e88f49ac05c9969
D 2022-10-08T17:27:05.762
C Improved\sdetection\sof\sdatabase\scorrupting\swhen\smoving\spages\son\san\nautovacuumed\sdatabase\swhen\screating\sa\snew\sbtree.\ndbsqlfuzz\s9a55397eae13cec64aebf1fd35489c3a90bdaac5
D 2022-10-10T12:02:53.891
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -528,7 +528,7 @@ F src/auth.c f4fa91b6a90bbc8e0d0f738aa284551739c9543a367071f55574681e0f24f8cf
F src/backup.c a2891172438e385fdbe97c11c9745676bec54f518d4447090af97189fd8e52d7
F src/bitvec.c 7c849aac407230278445cb069bebc5f89bf2ddd87c5ed9459b070a9175707b3d
F src/btmutex.c 6ffb0a22c19e2f9110be0964d0731d2ef1c67b5f7fabfbaeb7b9dabc4b7740ca
F src/btree.c ef9c126d6dc5dff8ff76abc807dfef5b8aac42144e3be11cbcd9cb6eaecef580
F src/btree.c 74fc5f6a0577df703d6f98d0c51ee0d8d91d22dbc0ba86e42e056517e2b45576
F src/btree.h 74d64b8f28cfa4a894d14d4ed64fa432cd697b98b61708d4351482ae15913e22
F src/btreeInt.h 8ce1332edd89dfd2461d561ac10a0ab5601c8e06200cb5230596c3caaf54482e
F src/build.c 6e3ee380a4f0ff95de4b53bf510f66600cff08e4e04b92e95fae789072563f8f
@ -2002,8 +2002,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 63d9efe277759d4daa29794846b60c6f55491496618f423f61468df72d0a4633
R e0f7913bc96b580aa6941cfc15392c69
P 1e2796b3741a4c0b966e6c01a7d62dea8de9d1f4bededea3d7ba7004dabc2ffe
R 87396513be591e6dc5cb0d1c97d70179
U drh
Z 28ed4e90d35f287e1294ec9151009f9d
Z bc3536edefe4a38a9e628abd562bbf72
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
1e2796b3741a4c0b966e6c01a7d62dea8de9d1f4bededea3d7ba7004dabc2ffe
327965bc71023d9380a9d6805062659108dab4bfcd386b7aba813754f270d33a

View File

@ -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;