Skip to content

Commit

Permalink
Avoid double-free in regexec after stack_double
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn authored and XrXr committed Nov 8, 2024
1 parent a9e377d commit 8628db1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4217,9 +4217,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
return ONIGERR_UNEXPECTED_BYTECODE;

timeout:
STACK_SAVE;
xfree(xmalloc_base);
if (stk_base != stk_alloc || IS_NOT_NULL(msa->stack_p))
xfree(stk_base);
return ONIGERR_TIMEOUT;
}

Expand Down

0 comments on commit 8628db1

Please sign in to comment.