Skip to content

Commit 5ad075c

Browse files
committed
patch 7.4.937
Problem: Segfault reading unitialized memory. Solution: Do not read match \z0, it does not exist. (Marius Gedminas, closes #497)
1 parent 294a7e5 commit 5ad075c

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/regexp_nfa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6947,7 +6947,8 @@ nfa_regtry(prog, col, tm)
69476947
{
69486948
cleanup_zsubexpr();
69496949
re_extmatch_out = make_extmatch();
6950-
for (i = 0; i < subs.synt.in_use; i++)
6950+
/* Loop over \z1, \z2, etc. There is no \z0. */
6951+
for (i = 1; i < subs.synt.in_use; i++)
69516952
{
69526953
if (REG_MULTI)
69536954
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
937,
744746
/**/
745747
936,
746748
/**/

0 commit comments

Comments
 (0)