mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
jscript: Handle star and opt operators while matching global regex properly.
Before this fix, the regex engine would run into an infinite loop and OOM when encountering a quantifier allowing a zero amount of items in a REG_GLOB regex.
This commit is contained in:
parent
721b7f5df6
commit
1365b27a6b
Notes:
Alexandre Julliard
2024-11-19 23:23:45 +01:00
Approved-by: Jacek Caban (@jacek) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6840
1 changed files with 3 additions and 0 deletions
|
@ -208,6 +208,9 @@ static HRESULT regexp_match(script_ctx_t *ctx, jsdisp_t *dispex, jsstr_t *jsstr,
|
|||
ret[i].index = result->cp - str - result->match_len;
|
||||
ret[i++].length = result->match_len;
|
||||
|
||||
if (result->match_len == 0)
|
||||
result->cp++;
|
||||
|
||||
if(!gflag && !(This->jsregexp->flags & REG_GLOB)) {
|
||||
hres = S_OK;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue