0
0
mirror of https://github.com/vim/vim.git synced 2025-10-20 08:14:18 -04:00

patch 9.1.1043: [security]: segfault in win_line()

Problem:  [security]: segfault in win_line()
          (fizz-is-on-the-way)
Solution: Check that ScreenLines is not NULL

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-j3g9-wg22-v955

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2025-01-20 22:55:57 +01:00
parent 4cbc54a743
commit 9d1bed5ecc
4 changed files with 13 additions and 2 deletions

View File

@@ -4478,13 +4478,15 @@ gui_do_scroll(void)
/*
* Don't call updateWindow() when nothing has changed (it will overwrite
* the status line!).
*
* Check for ScreenLines, because in ex-mode, we don't have a valid display.
*/
if (old_topline != wp->w_topline
if (ScreenLines != NULL && (old_topline != wp->w_topline
|| wp->w_redr_type != 0
#ifdef FEAT_DIFF
|| old_topfill != wp->w_topfill
#endif
)
))
{
int type = UPD_VALID;