mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Make the sum() function less precise and slower in order to avoid
harmless signed integer overflow UBSAN warnings from OSS-Fuzz. FossilOrigin-Name: 1be0646a2c352dbf03d2af87fd48b6f9edfd68666790ac6863144ac95f3e0621
This commit is contained in:
10
src/util.c
10
src/util.c
@@ -1761,8 +1761,14 @@ int sqlite3VListNameToNum(VList *pIn, const char *zName, int nName){
|
||||
|
||||
/* Compute z = (i64)x */
|
||||
void sqlite3DDFromInt(i64 x, double *z){
|
||||
z[0] = (double)x;
|
||||
z[1] = (double)(x - (i64)z[0]);
|
||||
if( x > -4503599627370496L && x < 4503599627370496 ){
|
||||
z[0] = (double)x;
|
||||
z[1] = 0.0;
|
||||
}else{
|
||||
i64 y = x % 2048;
|
||||
z[0] = (double)(x - y);
|
||||
z[1] = (double)(x - (i64)z[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute z = x + y */
|
||||
|
||||
Reference in New Issue
Block a user