mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Changes to avoid undefined behavior in memset() and memcpy() and in the
comparisons of pointers from different allocations. All problems are found by analysis tools - none have been seen in the wild. FossilOrigin-Name: 901d0b8f3b72e96ffa8e9436993a12980f5ebd51
This commit is contained in:
@@ -7521,8 +7521,13 @@ static int balance_nonroot(
|
||||
** overflow cell), we can skip updating the pointer map entries. */
|
||||
if( iOld>=nNew
|
||||
|| pNew->pgno!=aPgno[iOld]
|
||||
#ifdef HAVE_STDINT_H
|
||||
|| (intptr_t)pCell<(intptr_t)aOld
|
||||
|| (intptr_t)pCell>=(intptr_t)&aOld[usableSize]
|
||||
#else
|
||||
|| pCell<aOld
|
||||
|| pCell>=&aOld[usableSize]
|
||||
#endif
|
||||
){
|
||||
if( !leafCorrection ){
|
||||
ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc);
|
||||
|
Reference in New Issue
Block a user