patch 9.2.0113: winhighlight pointer may be used uninitialized
Commit:
https://github.com/vim/vim/commit/9c4cb7145fc437c1f31c94767d72e15fd60f0b25
Author: Foxe Chen <
chen...@gmail.com>
Date: Thu Mar 5 20:50:24 2026 +0000
patch 9.2.0113: winhighlight pointer may be used uninitialized
Problem: winhighlight pointer may be used uninitialized causing a crash
Solution: Initialize pointer in win_init() and win_init_empty()
(Foxe Chen).
closes: #19601
Signed-off-by: Foxe Chen <
chen...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/version.c b/src/version.c
index 6beefa483..3cddb4bc0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 113,
/**/
112,
/**/
diff --git a/src/window.c b/src/window.c
index defcc70e6..c078ed9ac 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1565,6 +1565,7 @@ win_init(win_T *newp, win_T *oldp, int flags UNUSED)
newp->w_wrow = oldp->w_wrow;
newp->w_fraction = oldp->w_fraction;
newp->w_prev_fraction_row = oldp->w_prev_fraction_row;
+ newp->w_hl = NULL;
copy_jumplist(oldp, newp);
#ifdef FEAT_QUICKFIX
if (flags & WSP_NEWLOC)
@@ -2521,6 +2522,7 @@ win_init_empty(win_T *wp)
wp->w_prev_pcmark.lnum = 0;
wp->w_prev_pcmark.col = 0;
wp->w_topline = 1;
+ wp->w_hl = NULL;
#ifdef FEAT_DIFF
wp->w_topfill = 0;
#endif