mirror of
https://github.com/bellard/quickjs.git
synced 2025-12-31 05:39:10 +03:00
removed buffer overflows introduced in regexp optimizations
This commit is contained in:
@@ -2737,7 +2737,7 @@ static intptr_t lre_exec_backtrack(REExecContext *s, uint8_t **capture,
|
|||||||
if (idx2 >= 0)
|
if (idx2 >= 0)
|
||||||
capture[idx2] = sp[-1].ptr;
|
capture[idx2] = sp[-1].ptr;
|
||||||
else
|
else
|
||||||
aux_stack[-idx2 + 1] = sp[-1].ptr;
|
aux_stack[-idx2 - 1] = sp[-1].ptr;
|
||||||
sp -= 2;
|
sp -= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2794,7 +2794,7 @@ static intptr_t lre_exec_backtrack(REExecContext *s, uint8_t **capture,
|
|||||||
if (idx2 >= 0)
|
if (idx2 >= 0)
|
||||||
capture[idx2] = sp[-1].ptr;
|
capture[idx2] = sp[-1].ptr;
|
||||||
else
|
else
|
||||||
aux_stack[-idx2 + 1] = sp[-1].ptr;
|
aux_stack[-idx2 - 1] = sp[-1].ptr;
|
||||||
sp -= 2;
|
sp -= 2;
|
||||||
}
|
}
|
||||||
pc = sp[-3].ptr;
|
pc = sp[-3].ptr;
|
||||||
|
|||||||
@@ -18022,7 +18022,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
|
|||||||
{
|
{
|
||||||
sp[-2] = JS_NewRegexp(ctx, sp[-2], sp[-1]);
|
sp[-2] = JS_NewRegexp(ctx, sp[-2], sp[-1]);
|
||||||
sp--;
|
sp--;
|
||||||
if (JS_IsException(sp[-2]))
|
if (JS_IsException(sp[-1]))
|
||||||
goto exception;
|
goto exception;
|
||||||
}
|
}
|
||||||
BREAK;
|
BREAK;
|
||||||
|
|||||||
Reference in New Issue
Block a user