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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user