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)
dbec74907e
This commit is contained in:
Jan Edmund Lazo 2019-09-13 19:31:56 -04:00 committed by Justin M. Keyes
parent 5a3c86205f
commit 4cee0e0731

View File

@ -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);