st
simple terminal
git clone https://9o.is/git/st.git
commit 2d6bc3bf13acb80447c5b4bba416c45fa7cb6af6 parent 4c4b1a1ce96e5d4b2db89d760cdfd9f46f57d30a Author: Milos Nikic <nikic.milos@gmail.com> Date: Wed, 14 Jan 2026 21:00:32 -0800 st: guard tsetdirt() against zero-sized terminal tsetdirt() assumes term.row > 0. During early init or resize paths this may not hold, leading to out-of-bounds access. Bail out early if there are no rows. Diffstat:
| M | st.c | | | 3 | +++ |
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/st.c b/st.c @@ -965,6 +965,9 @@ tsetdirt(int top, int bot) { int i; + if (term.row <= 0) + return; + LIMIT(top, 0, term.row-1); LIMIT(bot, 0, term.row-1);