diff options
author | drh <> | 2025-02-16 10:57:25 +0000 |
---|---|---|
committer | drh <> | 2025-02-16 10:57:25 +0000 |
commit | f4fc2ee20311a0a5141726c71d318ab52001c974 (patch) | |
tree | fc56bd57453ad843a8d9102bffd3572ae9863334 /src | |
parent | ac729894be0d60e9bf298b3c45611a4bf7b74b1c (diff) | |
download | sqlite-f4fc2ee20311a0a5141726c71d318ab52001c974.tar.gz sqlite-f4fc2ee20311a0a5141726c71d318ab52001c974.zip |
Add a typecast to avoid 32-bit integer overflow in the concat_ws()
function with an enormous separator values and many arguments.
FossilOrigin-Name: 498e3f1cf57f164fbd8380e92bf91b9f26d6aa05d092fcd135d754abf1e5b1b5
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/func.c b/src/func.c index 52462b468..222c9ac64 100644 --- a/src/func.c +++ b/src/func.c @@ -1570,7 +1570,7 @@ static void concatFuncCore( for(i=0; i<argc; i++){ n += sqlite3_value_bytes(argv[i]); } - n += (argc-1)*nSep; + n += (argc-1)*(i64)nSep; z = sqlite3_malloc64(n+1); if( z==0 ){ sqlite3_result_error_nomem(context); |