1
0
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:
drh
2023-06-30 11:51:36 +00:00
parent 2ddfa6a360
commit 60f41362cf
5 changed files with 26 additions and 15 deletions

View File

@@ -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 */