mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
When doing the sqlite3BtreeInsert() overwrite optimization, make sure the
memcpy() does not extend off the end of the page. FossilOrigin-Name: 684ef4582ed19b2af22dda6fc085c70464f92f1b
This commit is contained in:
@@ -8068,6 +8068,7 @@ int sqlite3BtreeInsert(
|
||||
** doing that is no faster then skipping this optimization and just
|
||||
** calling dropCell() and insertCell(). */
|
||||
assert( rc==SQLITE_OK ); /* clearCell never fails when nLocal==nPayload */
|
||||
if( oldCell+szNew > pPage->aDataEnd ) return SQLITE_CORRUPT_BKPT;
|
||||
memcpy(oldCell, newCell, szNew);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user