fix(pum): crash when resizing grid with pumborder set (#36404)

Problem: Grid size check didn't account for border_width, causing
row index out of bounds when drawing bordered popup menu.

Solution: Check grid.rows against pum_height + border_width.
This commit is contained in:
glepnir
2025-11-10 07:07:25 +08:00
committed by GitHub
parent a0678a5849
commit 76fdd9b882
2 changed files with 36 additions and 1 deletions

View File

@@ -660,7 +660,8 @@ void pum_redraw(void)
pum_invalid = false;
must_redraw_pum = false;
if (!pum_grid.chars || pum_grid.rows != pum_height || pum_grid.cols != grid_width) {
if (!pum_grid.chars || pum_grid.rows != pum_height + border_width
|| pum_grid.cols != grid_width + border_width) {
grid_alloc(&pum_grid, pum_height + border_width, grid_width + border_width,
!invalid_grid, false);
ui_call_grid_resize(pum_grid.handle, pum_grid.cols, pum_grid.rows);