1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Avoid use of uninitialized memory while running defragmentPage() on a

corrupt database file.
dbsqlfuzz 4c45cecc0b255aaf2ea85453ccd17e814fd0b6b2

FossilOrigin-Name: 35e40d75754ec6fb93fe57c6ecbe731104e77c997d7e17ef1a22984837dfcab2
This commit is contained in:
drh
2021-06-07 13:50:36 +00:00
parent fe972341a5
commit ccf0bb49bb
3 changed files with 8 additions and 8 deletions

View File

@@ -1535,7 +1535,7 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){
if( temp==0 ){
if( cbrk==pc ) continue;
temp = sqlite3PagerTempSpace(pPage->pBt->pPager);
memcpy(&temp[iCellStart], &data[iCellStart], (cbrk+size) - iCellStart);
memcpy(&temp[iCellStart], &data[iCellStart], usableSize - iCellStart);
src = temp;
}
memcpy(&data[cbrk], &src[pc], size);