mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 18:28:19 +00:00
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)
53efb18530
This commit is contained in:
@@ -3843,11 +3843,12 @@ static char_u *did_set_spell_option(bool is_spellfile)
|
|||||||
* Return error message when failed, NULL when OK.
|
* Return error message when failed, NULL when OK.
|
||||||
*/
|
*/
|
||||||
static char_u *compile_cap_prog(synblock_T *synblock)
|
static char_u *compile_cap_prog(synblock_T *synblock)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
regprog_T *rp = synblock->b_cap_prog;
|
regprog_T *rp = synblock->b_cap_prog;
|
||||||
char_u *re;
|
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;
|
synblock->b_cap_prog = NULL;
|
||||||
} else {
|
} else {
|
||||||
// Prepend a ^ so that we only match at one column
|
// Prepend a ^ so that we only match at one column
|
||||||
|
Reference in New Issue
Block a user