]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0113: winhighlight pointer may be used uninitialized v9.2.0113
authorFoxe Chen <chen.foxe@gmail.com>
Thu, 5 Mar 2026 20:50:24 +0000 (20:50 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 5 Mar 2026 20:50:24 +0000 (20:50 +0000)
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.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/version.c
src/window.c

index 6beefa4837e058b264e402ae58e832a4936d2eb9..3cddb4bc0b03a880e5fd8e0c3e59f169fdad070d 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    113,
 /**/
     112,
 /**/
index defcc70e617aa183edc8664590918a0b59ee6df7..c078ed9aceb518474ce1d008c6c6e4c8823b9765 100644 (file)
@@ -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