mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
vim-patch:8.2.0678: rare crash for popup menu
Problem: Rare crash for popup menu.
Solution: Check for NULL pointer. (Nobuhiro Takasaki, closes vim/vim#6027)
d58a662f44
This commit is contained in:
@@ -63,9 +63,12 @@ static void pum_compute_size(void)
|
||||
pum_kind_width = 0;
|
||||
pum_extra_width = 0;
|
||||
for (int i = 0; i < pum_size; i++) {
|
||||
int w = vim_strsize(pum_array[i].pum_text);
|
||||
if (pum_base_width < w) {
|
||||
pum_base_width = w;
|
||||
int w;
|
||||
if (pum_array[i].pum_text != NULL) {
|
||||
w = vim_strsize(pum_array[i].pum_text);
|
||||
if (pum_base_width < w) {
|
||||
pum_base_width = w;
|
||||
}
|
||||
}
|
||||
if (pum_array[i].pum_kind != NULL) {
|
||||
w = vim_strsize(pum_array[i].pum_kind) + 1;
|
||||
|
Reference in New Issue
Block a user