1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Do not use the insert-overwrite optimization if the cell might overwrite the

page header.

FossilOrigin-Name: f60a83069168899dcfd706b4d0901084c7ce92d85277950317e962a8a98ec668
This commit is contained in:
drh
2019-07-22 23:24:01 +00:00
parent e209457295
commit 9378818d89
4 changed files with 14 additions and 9 deletions

View File

@@ -8726,7 +8726,12 @@ int sqlite3BtreeInsert(
** new entry uses overflow pages, as the insertCell() call below is
** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */
assert( rc==SQLITE_OK ); /* clearCell never fails when nLocal==nPayload */
if( oldCell+szNew > pPage->aDataEnd ) return SQLITE_CORRUPT_BKPT;
if( oldCell < pPage->aData+pPage->hdrOffset+10 ){
return SQLITE_CORRUPT_BKPT;
}
if( oldCell+szNew > pPage->aDataEnd ){
return SQLITE_CORRUPT_BKPT;
}
memcpy(oldCell, newCell, szNew);
return SQLITE_OK;
}