patch 8.2.0033: crash when make_extmatch() runs out of memory
Problem: Crash when make_extmatch() runs out of memory.
Solution: Check for NULL. (Dominique Pelle, closs #5392)
diff --git a/src/regexp_bt.c b/src/regexp_bt.c
index b71b862..78be2b5 100644
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -4568,6 +4568,8 @@
cleanup_zsubexpr();
re_extmatch_out = make_extmatch();
+ if (re_extmatch_out == NULL)
+ return 0;
for (i = 0; i < NSUBEXP; i++)
{
if (REG_MULTI)
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index fb512f9..a288ea4 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -7070,6 +7070,8 @@
{
cleanup_zsubexpr();
re_extmatch_out = make_extmatch();
+ if (re_extmatch_out == NULL)
+ return 0;
// Loop over \z1, \z2, etc. There is no \z0.
for (i = 1; i < subs.synt.in_use; i++)
{
diff --git a/src/version.c b/src/version.c
index 88ea924..3c2c49b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 33,
+/**/
32,
/**/
31,