CodeAi (https://github.com/C0deAi), an automated repair tool developed at 
QbitLogic (www.qbitlogic.com), suggested the following fix. Could I submit it 
as a patch if it looks alright? 

src/fold.c: “*wp->w_p_fdt” pointer is checked for null but not “wp” pointer. No 
default initialization provided for “wp”. The condition in the if statement is 
tightening to include a null check on “wp”. A snapshot of the bug report 
generated by CodeAi is attached.  A full report is available upon request.

 diff --git a/src/fold.c b/src/fold.c
 @@ -1894,7 +1894,7 @@ get_foldtext(
        /* a previous error should not abort evaluating 'foldexpr' */
        did_emsg = FALSE;
  
 -    if (*wp->w_p_fdt != NUL)
 +    if (wp && (*wp->w_p_fdt != NUL))
      {
        char_u  dashes[MAX_LEVEL + 2];
        win_T   *save_curwin;

Base-commit:4475b623960671898dac6a72b13a8d140402afa6

Also, CodeAi has several additional fixes for this project.  Please let me know 
if you are interested in seeing more from our tool. Thanks!

Sincerely,
Benjamin Bales

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui