1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Avoid a potential integer overflow in non-default builds of the fts3 matchinfo() function.

FossilOrigin-Name: aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda
This commit is contained in:
dan
2025-04-15 11:06:37 +00:00
parent 56da8772bd
commit 136afcfcc1
3 changed files with 11 additions and 11 deletions

View File

@ -1027,16 +1027,16 @@ static size_t fts3MatchinfoSize(MatchInfo *pInfo, char cArg){
break;
case FTS3_MATCHINFO_LHITS:
nVal = pInfo->nCol * pInfo->nPhrase;
nVal = (size_t)pInfo->nCol * pInfo->nPhrase;
break;
case FTS3_MATCHINFO_LHITS_BM:
nVal = pInfo->nPhrase * ((pInfo->nCol + 31) / 32);
nVal = (size_t)pInfo->nPhrase * ((pInfo->nCol + 31) / 32);
break;
default:
assert( cArg==FTS3_MATCHINFO_HITS );
nVal = pInfo->nCol * pInfo->nPhrase * 3;
nVal = (size_t)pInfo->nCol * pInfo->nPhrase * 3;
break;
}