1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-21 11:13:54 +03:00

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
This commit is contained in:
drh
2025-02-16 10:57:25 +00:00
parent ac729894be
commit f4fc2ee203
3 changed files with 9 additions and 9 deletions

View File

@@ -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);