aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-07-13 22:02:12 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-07-15 23:07:29 -0400
commit5be40b9aadbb313cd4bb8198d9e252b6469f522f (patch)
tree4b7ca41997307b5a434f2ad22034c52514e6f4f8
parenteace147bb0209ab0d238b79076b417d2f7d95275 (diff)
downloadrneovim-5be40b9aadbb313cd4bb8198d9e252b6469f522f.tar.gz
rneovim-5be40b9aadbb313cd4bb8198d9e252b6469f522f.tar.bz2
rneovim-5be40b9aadbb313cd4bb8198d9e252b6469f522f.zip
vim-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) https://github.com/vim/vim/commit/c57463c9c6ee893285f553e0ac3b2fe5935f16b8
-rw-r--r--src/nvim/regexp_nfa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index dc1ab971ab..a28e05bd7e 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -3002,8 +3002,8 @@ static nfa_state_T *post2nfa(int *postfix, int *end, int nfa_calc_size)
return NULL; \
}
- if (nfa_calc_size == FALSE) {
- /* Allocate space for the stack. Max states on the stack : nstate */
+ if (nfa_calc_size == false) {
+ // Allocate space for the stack. Max states on the stack: "nstate".
stack = xmalloc((nstate + 1) * sizeof(Frag_T));
stackp = stack;
stack_end = stack + (nstate + 1);