From 2630341db65772e0a636c2a1cfbd6bba8ca9b28d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 28 Feb 2023 07:19:03 +0800 Subject: fix(tui): avoid stack-use-after-scope with cursor color (#22435) --- src/nvim/tui/tui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index fee1d21672..48dc860ebd 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1109,8 +1109,8 @@ void tui_set_mode(TUIData *tui, ModeShape mode) // Hopefully the user's default cursor color is inverse. unibi_out_ext(tui, tui->unibi_ext.reset_cursor_color); } else { + char hexbuf[8]; if (tui->set_cursor_color_as_str) { - char hexbuf[8]; snprintf(hexbuf, 7 + 1, "#%06x", aep.rgb_bg_color); UNIBI_SET_STR_VAR(tui->params[0], hexbuf); } else { -- cgit