Commit Graph

20701 Commits

Author SHA1 Message Date
Christian Brabandt a65a52d684 patch 9.2.0496: [security]: Code Injection in cucumber filetype plugin
Problem:  [security]: Code Injection in cucumber filetype plugin
          (Christopher Lusk)
Solution: Use rubys Regexp.new() with the untrusted pattern

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-4473-94jm-w5x9

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-17 19:39:24 +00:00
Christian Brabandt f08ab2f4d7 patch 9.2.0495: [security]: runtime(netrw): code injection via NetrwBookHistSave()
Problem:  [security]: runtime(netrw): code injection via
          NetrwBookHistSave()
Solution: Properly quote the directory name using string() function
          (Srinivas Piskala Ganesh Babu)

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-crm5-rh6j-2c7c

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-17 18:53:48 +00:00
Maxim Kim f0e874a129 patch 9.2.0494: User commands cannot handle single args with spaces
Problem:  User commands cannot handle single args with spaces
Solution: Add the -nargs=_ attribute (Maxim Kim)

-nargs=_ allow user commands to have a single argument with spaces.

For example given the following Test command and TestComplete function:

```
vim9script
def TestComplete(A: string, _: string, _: number): list<string>
    var all = ["qqqq", "aaaa", "qq aa"]
    return all->matchfuzzy(A)
enddef
command! -nargs=_ -complete=customlist,TestComplete Test echo <q-args>
```

`:Test q a<tab>` should successfully complete `qq aa`

fixes:  #20102
closes: #20189

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-17 17:58:15 +00:00
Yasuhiro Matsumoto abecad5af0 patch 9.2.0493: popup: missing Popup, PopupBorder and PopupTitle hi groups
Problem:  popup: missing Popup, PopupBorder and PopupTitle highlight groups
Solution: add Popup, PopupBorder and PopupTitle highlight groups and
          fall back to Pmenu related highlighting groups (Yasuhiro Matsumoto).

fixes:  #20110
closes: #20208

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-17 17:49:42 +00:00
Yasuhiro Matsumoto 3db4c3a20b patch 9.2.0492: popup: decoration wrongly drawn with clipping on border
Problem:  popup: clipwindow popups with border and padding could still
          spill into the surrounding chrome of the host window
Solution: Consume the border first, then the padding, per edge; spill
          any leftover clip into the opposite edge's decoration; derive
          the bottom padding row from total_height; skip the scrollbar
          branch for clipwindow popups (Yasuhiro Matsumoto).

closes: #20227

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-17 09:27:04 +00:00
Zoltan Arpadffy d8c4774273 patch 9.2.0491: VMS: various build issues
Problem:  VMS: various build issues
Solution: Fix issues for VMS (Zoltan Arpadffy)

closes: #20131

Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-16 08:42:47 +00:00
glepnir 88b00d1c57 patch 9.2.0490: matchfuzzy() can crash on long multi-word patterns
Problem:  matchfuzzy() can crash on long multi-word patterns.
Solution: Clamp pat_chars to maxMatches and stop before calling
          match_positions() when the buffer is full (glepnir).

closes: #20209

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-16 08:36:39 +00:00
Doug Kearns f7e239bd0e runtime(sh): Update syntax, don't include parens in function name highlighting
Parentheses are not part of the function name so highlight them
differently.

closes: #20219

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-16 07:57:10 +00:00
Keith Smiley bc7f736a39 patch 9.2.0489: filetype: some Objective-C files are not recognized
Problem:  filetype: some Objective-C files are not recognized
Solution: Add g:filetype_mm override variable, improve the objective c
          pattern detection (Keith Smiley).

closes: #20221

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-16 07:46:25 +00:00
Hirohito Higashi b467b56ef0 patch 9.2.0488: statusline: status line highlight blends into adjacent vsep cells
Problem:  When two windows are placed side by side with vsplit and
          their status lines are connected (the cell between them
          is drawn with the 'stl' / 'stlnc' fillchar, not the
          'vert' character), that connecting cell still uses the
          VertSplit highlight.  The status line bar therefore
          looks broken at the separator column, and any custom
          edge highlight set in 'statusline' (%#XX# / %N*) is cut
          off there.
Solution: Make that connecting cell take the highlight from the
          neighbouring status line edge instead of VertSplit:
            - Next to the current window, use the current
              window's edge highlight, so the StatusLine bar (and
              any %#... at the edge) extends into the column
              without a seam.
            - Between two non-current windows whose status
              fillchar is a space, use the left window's
              right-edge highlight, so the StatusLineNC bar is
              continuous across the column too.
          Cells drawn with the 'vert' character (the two windows
          do not share a status line) keep the VertSplit
          highlight as before.

          Add Test_statusline_vsep_borrow_hl with two layouts
          (NC | cur | NC | NC and NC | NC | cur | NC) so all
          three cases above are covered.

closes: #20182

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 16:52:29 +00:00
Yasuhiro Matsumoto ee49669e8f patch 9.2.0487: viminfo: possible signed int overflow in register array
Problem:  viminfo: possible signed int overflow in register array growth
Solution: Cast to size_t (Yasuhiro Matsumoto)

The expression `limit * 2 * sizeof(string_T)` in read_viminfo_register()
multiplies in int and overflows once limit exceeds INT_MAX/2. Cast to
size_t first so the size computation stays unsigned. Defensive only;
reaching this path requires registers consuming many gigabytes.

closes: #20207

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 16:44:46 +00:00
Christian Brabandt de7a5b5425 patch 9.2.0486: out-of-bound read when recovering swap files
Problem:  out-of-bound read when recovering corrupted swap files
          (Rahul Hoysala)
Solution: Validate the db_txt_start field when recovering a swap
          file.

Supported by AI

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 16:34:53 +00:00
Foxe Chen e85e3e5d85 patch 9.2.0485: clipboard provider callback can be called recursively
Problem:  clipboard provider callback can be called recursively, leading
          to E132: Function call depth is higher than 'maxfuncdepth'
Solution: Prevent recursive calls of
          clip_provider_copy()/clip_provider_paste() (Foxe Chen).

closes: #20213

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 16:00:04 +00:00
Foxe Chen bec23ef65c patch 9.2.0484: TextPutPre triggers clipboard provider callback twice
Problem:  TextPutPre triggers clipboard provider callback twice
          when do_put() runs autocommands that themselves request
          the clipboard.
Solution: Guard do_put() and put_do_autocmd() with
          inc_clip_provider()/dec_clip_provider() so the provider
          is queried at most once per put operation (Foxe Chen).

closes: #20215

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 15:45:11 +00:00
Hirohito Higashi f281493c49 patch 9.2.0483: popup: terminal embedded in an opacity popup freezes Vim on input
Problem:  When a terminal buffer is shown inside a popup with 'opacity'
          set to a value other than 100, typing into it freezes Vim.
          Only the first keystroke is drawn; afterwards no input is
          processed and the screen stops updating.
Solution: When marking background lines for redraw to keep opacity
          blend cells fresh, do not raise must_redraw.  This marking
          happens from inside update_screen() (via
          may_update_popup_mask()), so raising must_redraw makes
          terminal_loop()'s "while (must_redraw != 0) update_screen()"
          loop never terminate.  Add redraw_win_range_now() that
          updates only the per-window state and use it from
          redraw_win_under_opacity_popup() (Hirohito Higashi)

fixes:  #20214
closes: #20220

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 15:02:48 +00:00
Foxe Chen 29fa934344 patch 9.2.0482: runtime(osc52): triggered twice with TextPutPoste autocmd
Problem:  runtime(osc52): triggered twice with TextPutPoste autocmd
Solution: Detect recursive trigger and return null (Foxe Chen)

closes: #20216

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-15 02:09:24 +00:00
Christian Brabandt 8e41c34aba patch 9.2.0481: runtime(netrw): command injection possible via maps
Problem:  runtime(netrw): command injection possible via crafted
          directory names in NetrwMaps() (Christopher Lusk)
Solution: Temporarily remove B flag in NetrwMaps() to prevent command
          injection

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-14 18:52:08 +00:00
Christian Brabandt 8af0f098c3 patch 9.2.0480: [security]: runtime(netrw): code injection via mf command
Problem:  [security]: runtime(netrw): code injection via mf command
          (Christopher Lusk, Zdenek Dohnal)
Solution: Do not use string concatenation inside the filter() commands
          (Zdenek Dohnal)

Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-66hr-7p6x-x5j3

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-14 16:43:15 +00:00
Christian Brabandt 3fb5e58fbc patch 9.2.0479: [security]: runtime(tar): command injection in tar plugin
Problem:  [security]: runtime(tar): command injection in tar plugin
          (Christopher Lusk)
Solution: Use the correct shellescape(args, 1) form for a :! command

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-2fpv-9ff7-xg5w

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-14 15:43:44 +00:00
John Marriott 8aecd377f0 patch 9.2.0478: channel: redundant str/length assignments in channel_part_info()
Problem:  channel: redundant str/length assignments in channel_part_info
Solution: Use the STR_LITERAL_SET() macro (John Marriott)

closes: #20199

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-12 17:58:21 +00:00
Yasuhiro Matsumoto 3a9e1bb7e2 patch 9.2.0477: popup: leftover content after popup_free under layout change
Problem:  popup_mask still marks the freed popup's cells as covered
          until may_update_popup_mask() runs inside the next
          update_screen.  Any screen_fill / screen_puts called in
          between (for example msg_clr_eos triggered by a status message
          from :copen) hits skip_for_popup() and silently drops writes
          to those cells, so the popup's chars survive on screen until
          those cells happen to be redrawn for another reason.
Solution: Add popup_clear_mask_for() and call it from popup_hide() and
          popup_free() when the popup was visible, so the upcoming
          writes take effect immediately (Yasuhiro Matsumoto)

Note: The test is limited to MS-Windows because the original report
      (#20178) was reproduced there and the redraw timing required to
      surface the bug differs on other platforms.

fixes:  #20178
closes: #20188

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-12 17:47:41 +00:00
glepnir 38237411e4 patch 9.2.0476: pattern completion leaks memory on alloc failures
Problem:  copy_substring_from_pos() leaked on ga_grow() failures,
          expand_pattern_in_buf() leaked "match" on ga_grow() failure,
          fuzzy_match_str_with_pos() ignored ga_grow() failures
Solution: Route failures through cleanup paths, check ga_grow before
          writing to ga_data (glepnir)

closes: #20203

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-12 17:40:19 +00:00
J. Paulo Seibt 74019bea8c patch 9.2.0475: runtime(netrw): bookmark paths not normalized
Problem:  the bookmarks list can have duplicate entries, more often
          in win32 (due to mixed slashes and capitalization) and when
          g:netrw_keepdir=0 (which could introduce relative paths).
          Duplicate entries could be: C:\foo\BAR\baz.file
                                     c:\foo\bar\baz.file
                                     c:/foo\BAR/baz.file
                                     BAR/baz.file
Solution: Normalize the paths and make sure they are always absolute
          (J. Paulo Seibt).

closes: #20194

Signed-off-by: J. Paulo Seibt <jpseibt@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-11 17:10:55 +00:00
K.Takata 7784fac15f patch 9.2.0474: MS-Windows: hard to tell which Visual Studio version was selected with MSVC
Problem:  When running msvc*.bat there is no indication of which
          Visual Studio version and target architecture got
          selected.
Solution: After vcvarsall.bat returns, echo the VS version, VC
          tools version and target architecture, and set the
          Command Prompt title accordingly (Ken Takata).

closes: #20193

Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-11 16:58:24 +00:00
zeertzjq a70b7a85af patch 9.2.0473: Pasting ". register without autocommands breaks TextPut*
Problem:  Pasting ". register without TextPut* autocommands breaks
          subsequent TextPut* autocommands (after 9.2.0470).
Solution: Only decrement add_last_insert if it has been incremented
          (zeertzjq).

closes: #20192

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-11 16:49:19 +00:00
Yasuhiro Matsumoto 51f1447d2a patch 9.2.0472: popup: column jitters when scrolled outside viewport
Problem:  popup: column jitters horizontally when textprop is scrolled
          above the host window's top (after v9.2.0469)
Solution: Compute the virtual column from the prop's actual line via
          getvcol() and translate it through prop_win's win_col_off /
          leftcol / wincol (Yasuhiro Matsumoto).

popup_screenpos_above_top() probed textpos2screenpos() at
prop_win->w_topline using the prop's own tp_col, so the returned
screen_scol picked up topline's tab stops and multi-byte widths instead
of the prop line's own.  Once the textprop scrolled above the host's
top, the popup's wincol jittered left/right every time a wider or
narrower line rotated into the topmost slot.

Compute the virtual column from the prop's actual line via getvcol()
and translate it through prop_win's win_col_off / leftcol / wincol.
Row extrapolation from topline is unchanged.

closes: #20187

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-11 16:29:27 +00:00
John Marriott 1b65cfbac5 patch 9.2.0471: vimvars di_key initialized at runtime
Problem:  evalvars_init() copies each vimvar's name into di_key at
          startup and runtime-checks that the name fits in
          DICTITEM16_KEY_LEN, even though all names are known at
          compile time.
Solution: Embed the name in di_key via the VV_NAME macro so the
          initialization happens at compile time.  Drop the
          runtime length check and the STRCPY loop (John Marriott).

closes: #20185

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-11 16:22:05 +00:00
Foxe Chen e0781bd5bf patch 9.2.0470: No way to hook into put commands
Problem:  No way to hook into put commands
          (yochem)
Solution: Introduce TextPutPre and TextPutPost autocommands
          (Foxe Chen).

fixes:  #18701
closes: #20144

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 19:17:19 +00:00
Yasuhiro Matsumoto e3d9929109 patch 9.2.0469: popup: textprop-anchored popups bleed past host window edges
Problem:  A popup anchored to a text property in a split window is
          positioned relative to the screen and may extend into
          adjacent splits or off-screen regions.  There is no way to
          confine the popup to the window that contains the textprop.
Solution: Add the "clipwindow" popup option to allow clipping the text
          property popup to the host window (Yasuhiro Matsumoto).

Adds a "clipwindow" boolean option to popup_create()/popup_setoptions().
When set on a textprop-anchored popup, the popup's drawn extent is
confined to its host (textprop) window's content rectangle so the popup
no longer bleeds across a horizontal split's statusline (top/bottom) or
a vsplit's separator (right) into another window.

The popup keeps its full logical size and position; only the rows or
columns that fall outside the host window's content area are skipped
during drawing, so a popup that scrolls toward the host's edge looks
visually "cut off" without its borders being relocated.  popup_getoptions
and popup_getpos continue to report the unclipped geometry.

Implementation:

  - w_popup_topoff / w_popup_bottomoff record how many rows of the
    popup fall outside the host on each side.  popup_adjust_position()
    computes them from the host rectangle after the logical layout is
    finalised, and update_popups() and the popup-mask builder subtract
    them when emitting cells/borders/scrollbar and when marking
    popup-owned cells.  win_update() is bracketed by transient
    w_height/w_topline/w_winrow adjustments so the buffer's drawn
    content matches the visible row range.

  - w_popup_rightclip is the horizontal counterpart for the host's
    right edge: the right border, padding and content columns past
    the host are not drawn.  win_update() is bracketed by a transient
    w_width reduction so the buffer text is not written past the
    host's right edge either.

  - When the textprop scrolls just above the host window's top, the
    popup is kept visible by extending the prop search above topline
    (new helper find_prop_in_lines) and synthesising a negative
    screen_row so the top-clip path can roll the popup off the top.
    When the textprop has scrolled far enough that even the bottom
    border would overlap the host edge -- or when the popup would
    overflow the host's left edge at all -- the popup is hidden, and
    unhidden again once it comes back within range.

  - The "reduce-height" / "clamp winrow to 0" fallbacks in
    popup_adjust_position are bypassed for host-clipped popups so the
    popup keeps its natural anchored position instead of being
    snapped to the screen edge.

    Left-edge partial clipping is intentionally not supported: it
    would require shrinking the buffer width during win_update, which
    reflows wrapped lines and corrupts the displayed content; the
    popup is hidden instead.

closes: #20166

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 19:02:38 +00:00
Yasuhiro Matsumoto ef1ecc3b61 patch 9.2.0468: popups: not correctly updated from a CmdlineChanged autocommand
Problem:  popup_show() from a CmdlineChanged autocommand doesn't update
          the screen (Mao-Yining)
Solution: Refresh the screen when popups need redraw
          (Yasuhiro Matsumoto).

popup_settext()/popup_show() called from a CmdlineChanged autocommand
did not refresh the screen because cmdline mode normally skips
update_screen(), so async info-popup updates only became visible after
a manual :redraw.  Refresh the screen when popups need redrawing right
after the autocommand.

fixes:  #20175
closes: #20179

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 18:20:01 +00:00
Hirohito Higashi 5ef1eec5c5 patch 9.2.0467: multi-line statusline loses highlighting attributes
Problem:  In a multi-line statusline (and 'tabpanel'), %#XX# / %N*
          set on one row do not persist on subsequent rows.
          build_stl_str_hl_local() rebuilds stl_items[] from scratch
          on every line break ("%@" or "\n"), so the highlight is
          reset at each row boundary even though within a row it
          stays until %* (or another %# / %*).
Solution: Carry the last Highlight item's stl_minwid across line
          breaks via a new in/out int* parameter "carry_hl".  At the
          start of each row, pre-insert a Highlight item from the
          carried value so the row begins under the same highlight;
          before returning, update the carried value with the row's
          final Highlight item.  Apply the same carry to the
          tabpanel rendering loop (Hirohito Higashi).

related: #19123
closes:  #20180

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 18:14:01 +00:00
Yasuhiro Matsumoto 3a8b9e09b2 patch 9.2.0466: popup: redraw can use stale blended cells
Problem:  popup: redraw can use stale blended cells
Solution: Save the old popup area and redraw the newly exposed region so
          opacity popups don't show stale blended cells when another
          popup moves or closes. Consolidate redraw helpers so the
          saved-area and exposed-area logic is shared across
          move/hide/close/settext/setoptions. Refactor popup redrawing
          code, add a regressions tests (Yasuhiro Matsumoto).

closes: #20172

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 17:23:12 +00:00
Christian Brabandt 2020e0bade patch 9.2.0465: modeline: foldmarker cannot be set with modelinestrict
Problem:  modeline: foldmarker cannot be set with modelinestrict
          (Lyderic Landry, after v9.2.0350)
Solution: Add foldmarker option to the whitelist

fixes:  #20028
closes: #20174

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 17:00:59 +00:00
J. Paulo Seibt ec76ac620b patch 9.2.0464: runtime(netrw): bookmarking directory uses current dir
Problem:  runtime(netrw): bookmarking directory uses current dir
Solution: Correctly handle netrw actual directory (J. Paulo Seibt)

fixes:  #10481
closes: #20169

Signed-off-by: J. Paulo Seibt <jpseibt@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 16:55:18 +00:00
Yegappan Lakshmanan 6b8d2262d3 patch 9.2.0463: Not able to use legacy expression evaluation in a vim9script maps
Problem:  Not able to use legacy expression evaluation in a vim9script
          maps
Solution: Explicitly set script version to 1 when the :legacy modifier has been
          used (Yegappan Lakshmanan).

fixe:   #20176
closes: #20177

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 16:41:35 +00:00
K.Takata 3a1ac7ced2 patch 9.2.0462: MS-Windows: workaround for assert error on GUI
Problem:  When Vim is built with debug mode, gvim causes an assertion
          error and stops working when running on Visual Studio
          Debugger.
Solution: Stop calling _set_fmode() if not needed (Ken Takata).

closes: #20181

Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-10 16:34:01 +00:00
Christian Brabandt 4f610f07b7 patch 9.2.0461: Corrupted undofile causes use-after-free
Problem:  The four pointer-resolution loops in u_read_undo() lack
          an i != j guard, so a header whose uh_next.seq equals
          its own uh_seq resolves uh_next.ptr to itself.  On
          buffer close, u_freeheader() sees uhp->uh_next.ptr !=
          NULL and skips updating b_u_oldhead, so u_blockfree()
          dereferences the freed header on the next iteration.
          The same pattern applies to uh_prev, uh_alt_next and
          uh_alt_prev.  A crafted .un~ file in the same directory
          as a text file can trigger the use-after-free and
          subsequent double-free when the buffer is closed.
          (Daniel Cervera)
Solution: Add an i != j guard to each of the four resolution
          loops, matching the guard already present in the
          duplicate-detection loop above.

closes: #20168

Supported by AI

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-09 14:41:37 +00:00
zeertzjq abd74fa122 patch 9.2.0460: did_set_shellpipe_redir() in wrong file
Problem:  did_set_shellpipe_redir() is a callback for a string option,
          but is not in optionstr.c (after 9.2.0458).
Solution: Move it to optionstr.c. Also add missing change from patch
          9.2.0455 (zeertzjq).

related: #20159
related: #20164
closes:  #20170

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-09 14:22:47 +00:00
Christian Brabandt 124f8becec patch 9.2.0459: tests: test_termcodes fails (after v9.2.0456)
Problem:  tests: test_termcodes fails, because it disabled DECRQM, but
          did not adjust the expected values in the test (after v9.2.0456)
Solution: Update the test

related: #20161
closes:  #20173

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-09 14:13:52 +00:00
Christian Brabandt 84ae09dd79 patch 9.2.0458: Crash with invalid shellredir/shellpipe value
Problem:  Crash with invalid shellredir/shellpipe value
          (bfredl)
Solution: Validate the option and allow only a single "%s".

fixes:  #20157
closes: #20159

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-08 21:32:21 +00:00
Christian Brabandt 2f00656b34 patch 9.2.0457: Compile warning about unused variable
Problem:  Compile warning about unused variable
          (Tony Mechelynck, after v9.2.0452)
Solution: Initialize the variable

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-08 21:22:28 +00:00
Foxe Chen 7644d9d611 patch 9.2.0456: stray p character displayed on some terms
Problem:  stray p character displayed on some terms
Solution: Make sending DECRQM more strict and disable it for a few more
          terminals (Foxe Chen)

fixes:  #20156
fixes:  #20140
closes: #20161

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-08 21:14:52 +00:00
zeertzjq 9694ff58fe patch 9.2.0455: 'findfunc' only allows extra info for cmdline completion
Problem:  'findfunc' only allows extra info for cmdline completion, not
          for actually finding files (Maxim Kim, after 9.2.0451).
Solution: Handle returning a list of dicts when actually finding files.
          Also fix crash on NULL string (zeertzjq).

fixes:  #20163
closes: #20164

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-08 21:09:48 +00:00
zeertzjq b207b5a2a3 patch 9.2.0454: tests: no test that "abbr" in customlist completion is shown
Problem:  No test that "abbr" in customlist completion is shown in pum.
Solution: Add some "abbr" fields to the existing test (zeertzjq).

closes: #20165

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-08 21:06:08 +00:00
Hirohito Higashi c895390e58 patch 9.2.0453: vertical separator of statusline blend into active statusline
Problem:  Since v9.2.0349, the vertical separator cell at status line
	  rows is drawn as a space with StatusLine highlight, hiding the
	  user's 'fillchars' "vert" or "stl"/"stlnc" character at that
	  cell (after v9.2.0349)
Solution: Drop the status line blend.  At status line rows the separator
	  cell goes back to using the status fillchar when adjacent
	  status lines are connected, or the vsep character otherwise.
	  (Same as before v9.2.0348)

Keep the VertSplitNC highlight group introduced in v9.2.0349.  The
highlight (VertSplit vs VertSplitNC) is selected based on whether the
current window is adjacent to the separator at the row.

Vertical separators are redrawn on current-window changes and on
:redrawstatus[!] so the VertSplit/VertSplitNC highlight is updated
immediately.

fixes:   #20089
related: #19951
closes:  #20167

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-08 21:03:12 +00:00
Yasuhiro Matsumoto b9871cef10 patch 9.2.0452: screen.c popup opacity blend logic is duplicated
Problem:  screen_line() has four near-identical blocks computing
          the popup_attr, the combined attr, the blend value and
          the underlying base attr in sequence when handling popups
          with opacity.  The duplication makes the function long
          and hard to follow, and changes have to be applied to all
          four sites.
Solution: Extract the shared computation into popup_blend_with_base()
          and popup_base_attr_or() helpers, and cache per-popup
          attrs once via popup_opacity_T.  No behavior change
          (Yasuhiro Matsumoto).

closes: #20154

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-07 19:40:16 +00:00
zeertzjq 58124789aa patch 9.2.0451: 'findfunc' can't return extra info for cmdline completion
Problem:  'findfunc' can't return extra info for cmdline completion
          (Maxim Kim).
Solution: Handle 'findfunc' return value in cmdline completion like that
          of "customlist" functions (zeertzjq).

fixes:  #20155
closes: #20158

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-07 19:32:23 +00:00
Christian Brabandt 9299332917 patch 9.2.0450: [security]: heap buffer overflow in spellfile.c read_compound()
Problem:  read_compound() in spellfile.c computes the size of the regex
          pattern buffer using signed-int arithmetic on the attacker
          controlled SN_COMPOUND sectionlen.  With sectionlen=0x40000008
          and UTF-8 encoding active the multiplication wraps to 27 while
          the per-byte loop writes up to ~1B bytes, overflowing the heap.
          Reachable when loading a crafted .spl file (e.g. via 'set spell'
          after a modeline sets 'spelllang').  The cp/ap/crp allocations
          have the same int + 1 overflow class (Daniel Cervera)
Solution: Use type size_t as buffer size and reject values larger than
          COMPOUND_MAX_LEN (100000).  Apply the same size_t treatment to
          the cp/ap/crp allocations.

Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-q4jv-r9gj-6cwv

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-07 18:49:53 +00:00
Christian Brabandt 0ab4316fce patch 9.2.0449: Make proto fails in non GTK builds
Problem:  Make proto fails when not building the GTK gui
Solution: Test for $GLIB_COMPILE_RESOURCES as done elsewhere

closes: #20145

Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-06 18:17:00 +00:00
Yasuhiro Matsumoto 4bcc8ba93d patch 9.2.0448: Vim9: dangling cmdline pointer after skip_expr_cctx()
Problem:  Vim9: dangling cmdline pointer after skip_expr_cctx()
          (Foxe Chen)
Solution: Extract the cmdline restoration logic from compile_lambda into
          a helper restore_cmdline_arg() and call it from
          skip_expr_cctx() too, so a skipped lambda inside an "else"
          branch does not leave "*arg" pointing into freed evalarg
          memory (Yasuhiro Matsumoto).

fixes:  #20147
closes: #20148

Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-05-06 18:02:09 +00:00