aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-03-15 23:18:47 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-04-13 12:00:31 -0400
commitd2abd1be80774f13416f566a1e8448635f1cf5e6 (patch)
treedd7bc301fe8f6928c51bf70a901c8ddd972278f1
parent36326436f7f6f5c6cf18bc4dc4f66654f07d6c89 (diff)
downloadrneovim-d2abd1be80774f13416f566a1e8448635f1cf5e6.tar.gz
rneovim-d2abd1be80774f13416f566a1e8448635f1cf5e6.tar.bz2
rneovim-d2abd1be80774f13416f566a1e8448635f1cf5e6.zip
vim-patch:8.1.2147: crash when allocating memory fails
Problem: Crash when allocating memory fails. (Zu-Ming Jiang) Solution: Check that 'spellcapcheck' is not NULL. (closes vim/vim#5048) https://github.com/vim/vim/commit/53efb18530cc3940d7af2ea338947783ea5495ed
-rw-r--r--src/nvim/option.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 7582b0dc17..86a7d9b3c2 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -3843,11 +3843,12 @@ static char_u *did_set_spell_option(bool is_spellfile)
* Return error message when failed, NULL when OK.
*/
static char_u *compile_cap_prog(synblock_T *synblock)
+ FUNC_ATTR_NONNULL_ALL
{
regprog_T *rp = synblock->b_cap_prog;
char_u *re;
- if (*synblock->b_p_spc == NUL) {
+ if (synblock->b_p_spc == NULL || *synblock->b_p_spc == NUL) {
synblock->b_cap_prog = NULL;
} else {
// Prepend a ^ so that we only match at one column