removed buffer overflows introduced in regexp optimizations

This commit is contained in:
Fabrice Bellard
2025-11-22 12:10:55 +01:00
parent 728ed94889
commit a77400796d
2 changed files with 3 additions and 3 deletions

View File

@@ -2737,7 +2737,7 @@ static intptr_t lre_exec_backtrack(REExecContext *s, uint8_t **capture,
if (idx2 >= 0)
capture[idx2] = sp[-1].ptr;
else
aux_stack[-idx2 + 1] = sp[-1].ptr;
aux_stack[-idx2 - 1] = sp[-1].ptr;
sp -= 2;
}
@@ -2794,7 +2794,7 @@ static intptr_t lre_exec_backtrack(REExecContext *s, uint8_t **capture,
if (idx2 >= 0)
capture[idx2] = sp[-1].ptr;
else
aux_stack[-idx2 + 1] = sp[-1].ptr;
aux_stack[-idx2 - 1] = sp[-1].ptr;
sp -= 2;
}
pc = sp[-3].ptr;