[Bug #20239] Fix overflow at down-casting

This commit is contained in:
Nobuyoshi Nakada 2024-02-07 11:00:47 +09:00
parent 8bd83bb133
commit 75aaeb35b8
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
2 changed files with 2 additions and 2 deletions

View file

@ -3521,7 +3521,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
n = pend - pstart;
DATA_ENSURE(n);
sprev = s;
STRING_CMP_IC(case_fold_flag, pstart, &s, (int)n, end);
STRING_CMP_IC(case_fold_flag, pstart, &s, n, end);
while (sprev + (len = enclen(encode, sprev, end)) < s)
sprev += len;