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.
---
 st.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/st.c b/st.c
index e55e7b3..6f40e35 100644
--- 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);
 
-- 
2.52.0


Reply via email to