mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Fix additional cases of possible signed integer overflow, especially with
regard to negation. FossilOrigin-Name: 2d5800bd8cfc7d7f5578a71b1aeaa74b2ec4b372
This commit is contained in:
@@ -4901,11 +4901,9 @@ static int allocateBtreePage(
|
||||
u32 i;
|
||||
int dist;
|
||||
closest = 0;
|
||||
dist = get4byte(&aData[8]) - nearby;
|
||||
if( dist<0 ) dist = -dist;
|
||||
dist = sqlite3AbsInt32(get4byte(&aData[8]) - nearby);
|
||||
for(i=1; i<k; i++){
|
||||
int d2 = get4byte(&aData[8+i*4]) - nearby;
|
||||
if( d2<0 ) d2 = -d2;
|
||||
int d2 = sqlite3AbsInt32(get4byte(&aData[8+i*4]) - nearby);
|
||||
if( d2<dist ){
|
||||
closest = i;
|
||||
dist = d2;
|
||||
|
Reference in New Issue
Block a user