Hi,

Running Vim with the clang undefined behavior sanitizer (UBSan) finds
an access using a NULL pointer in ex_cmds.c. The attached patch fixes
this issue.

- Yegappan

-- 
-- 
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.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 206ead1..2b43b7c 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3967,7 +3967,8 @@ do_ecmd(
                     * <VN> We could instead free the synblock
                     * and re-attach to buffer, perhaps.
                     */
-                   if (curwin->w_s == &(curwin->w_buffer->b_s))
+                   if (curwin->w_buffer != NULL &&
+                           curwin->w_s == &(curwin->w_buffer->b_s))
                        curwin->w_s = &(buf->b_s);
 #endif
                    curwin->w_buffer = buf;

Raspunde prin e-mail lui