summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-12-14 21:42:00 +0100
committerBram Moolenaar <Bram@vim.org>2016-12-14 21:42:00 +0100
commitc4bfedabe057c05f09a455a5851089e177fa9c00 (patch)
treefbb9f1dee8c9bb17c860854fdf922ab454c8b027 /src/ex_cmds.c
parentfe38b494fff56cd9b2fcaeef26a8fd7b6557d69c (diff)
downloadvim-git-c4bfedabe057c05f09a455a5851089e177fa9c00.tar.gz
patch 8.0.0134v8.0.0134
Problem: Null pointer access reported by UBsan. Solution: Check curwin->w_buffer is not NULL. (Yegappan Lakshmanan)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 206ead185..484a22c74 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;