0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 9.0.1916: Crash when allocating large terminal screen

Problem:  Crash when allocating large terminal screen
Solution: Don't allow values > 1000 for terminal
          screen columns and rows

closes: #13126

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2023-09-19 21:05:20 +02:00
parent 476733f3d0
commit aa64ba1587
5 changed files with 40 additions and 1 deletions

View File

@@ -272,6 +272,10 @@ parse_termwinsize(win_T *wp, int *rows, int *cols)
}
*rows = atoi((char *)wp->w_p_tws);
*cols = atoi((char *)p + 1);
if (*rows > 1000)
*rows = 1000;
if (*cols > 1000)
*cols = 1000;
return minsize;
}