1
0
mirror of git://git.suckless.org/st synced 2026-01-17 01:38:11 +00:00

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.
This commit is contained in:
Milos Nikic 2026-01-14 21:00:32 -08:00 committed by Hiltjo Posthuma
parent 0723b7e39e
commit 688f70add0

3
st.c
View File

@ -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);