From 4cee0e0731ecac797465f112be2c0b803b654aec Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 13 Sep 2019 19:31:56 -0400 Subject: [PATCH] vim-patch:8.1.2026: possibly using uninitialized memory #11013 Problem: Possibly using uninitialized memory. Solution: Check if "dict" is NULL. (closes vim/vim#4925) https://github.com/vim/vim/commit/dbec74907eb614517bcf27116d5aad32e087f241 --- src/nvim/ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/ops.c b/src/nvim/ops.c index bfd02d4ff1..898501e6dd 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -5577,11 +5577,12 @@ void cursor_pos_info(dict_T *dict) } bom_count = bomb_size(); - if (bom_count > 0) { + if (dict == NULL && bom_count > 0) { vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE - STRLEN(IObuff), _("(+%" PRId64 " for BOM)"), (int64_t)bom_count); } if (dict == NULL) { + // Don't shorten this message, the user asked for it. p = p_shm; p_shm = (char_u *)""; msg(IObuff);