From: Bram Moolenaar Date: Wed, 26 Dec 2018 21:04:41 +0000 (+0100) Subject: patch 8.1.0641: no check for out-of-memory when converting regexp X-Git-Tag: v8.1.0641 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c57463c9c6ee893285f553e0ac3b2fe5935f16b8;p=thirdparty%2Fvim.git patch 8.1.0641: no check for out-of-memory when converting regexp Problem: No check for out-of-memory when converting regexp. Solution: Bail out when lalloc() returns NULL. (John Marriott) --- diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index ff6215e73b..d779feead7 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -3218,8 +3218,10 @@ post2nfa(int *postfix, int *end, int nfa_calc_size) if (nfa_calc_size == FALSE) { - /* Allocate space for the stack. Max states on the stack : nstate */ + // Allocate space for the stack. Max states on the stack: "nstate'. stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE); + if (stack == NULL) + return NULL; stackp = stack; stack_end = stack + (nstate + 1); } diff --git a/src/version.c b/src/version.c index 10ba489e55..3150da92f5 100644 --- a/src/version.c +++ b/src/version.c @@ -799,6 +799,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 641, /**/ 640, /**/