Christ van Willegen wrote:

> Patch 8.2.3662
> Problem:    Illegal memory access if malloc() fails.
> Solution:   Check 'foldmethod' is not empty. (closes #9207)
> Files:      src/fold.c

[...]

>       int
>   foldmethodIsManual(win_T *wp)
>   {
> !     return (wp->w_p_fdm[0] != NUL && wp->w_p_fdm[3] == 'u');
>   }

> Couldn't wp->w_p_fdm itself be NULL?

No, string options that can't be set use "empty_option", which is an
empty string. That avoids a lot of NULL pointer checks.

-- 
My Go, this amn keyboar oesn't have a .

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211124224054.AAFE11C0A05%40moolenaar.net.

Raspunde prin e-mail lui