From dab1ddca8c5a93330528a3dde96b9b8a10a2ce01 Mon Sep 17 00:00:00 2001 From: Bakkeby Date: Wed, 18 Feb 2026 11:21:22 +0100 Subject: [PATCH] Bump to 688f70a. 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. https://git.suckless.org/st/commit/688f70add0d1da8a416bf7df763328d694a24a3a.html --- README.md | 2 +- st.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a3d670a..8550a70 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.9.3 (6e97047, 2025-08-09) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. +Similar to [dwm-flexipatch](https://github.com/bakkeby/dwm-flexipatch) this st 0.9.3 (688f70a, 2026-01-15) project has a different take on st patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/st-flexipatch/blob/master/patches.def.h): ```c diff --git a/st.c b/st.c index 661926d..ae436f3 100644 --- a/st.c +++ b/st.c @@ -1102,6 +1102,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);