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:
parent
0723b7e39e
commit
688f70add0
1 changed files with 3 additions and 0 deletions
3
st.c
3
st.c
|
|
@ -965,6 +965,9 @@ tsetdirt(int top, int bot)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (term.row <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
LIMIT(top, 0, term.row-1);
|
LIMIT(top, 0, term.row-1);
|
||||||
LIMIT(bot, 0, term.row-1);
|
LIMIT(bot, 0, term.row-1);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue