[hackers] [dmenu][PATCH] fix: Do not crash on e.g. dmenu < /dev/null

From: S. Gilles <sgilles_AT_math.umd.edu>
Date: Tue, 28 Jun 2016 01:11:50 -0400

---
 dmenu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dmenu.c b/dmenu.c
index 0e7b70b..e926eca 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -480,7 +480,7 @@ readstdin(void)
 	}
 	if (items)
 		items[i].text = NULL;
-	inputw = TEXTW(items[imax].text);
+	inputw = items ? TEXTW(items[imax].text) : 0;
 	lines = MIN(lines, i);
 }
 
-- 
2.9.0
Received on Tue Jun 28 2016 - 07:11:50 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 28 2016 - 07:24:21 CEST