commit aa3adb3e6f6e6b95be3386058843f2790d193186
parent 464f0be145387883d0667a778aa437c01a833177
Author: hhvn <dev@hhvn.uk>
Date: Fri, 3 Dec 2021 12:59:15 +0000
dwm.c: prevent overflow in drawstatusbar code processing
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dwm.c b/dwm.c
@@ -759,7 +759,7 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
x += w;
/* process code */
- while (text[++i] != '^') {
+ while (text[++i] != '^' && text[i]) {
if (text[i] == 'c') {
char buf[8];
memcpy(buf, (char*)text+i+1, 7);