[hackers] [PATCH st] Fix null pointer access in strhandle

From: <suckless_AT_jochen.sprickerhof.de>
Date: Mon, 27 Dec 2021 10:47:56 +0100

From: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>

As the comment above says: "here p = NULL" so strcmp will segfault.
This is a regression of 8e31030 and does not seem to be needed.
---
 st.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/st.c b/st.c
index 6783c2b..8d1fbb4 100644
--- a/st.c
+++ b/st.c
_AT_@ -1962,10 +1962,7 @@ strhandle(void)
 			/* FALLTHROUGH */
 		case 104: /* color reset, here p = NULL */
 			j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
-
-			if (!strcmp(p, "?"))
-				osc4_color_response(j);
-			else if (xsetcolorname(j, p)) {
+			if (xsetcolorname(j, p)) {
 				if (par == 104 && narg <= 1)
 					return; /* color reset without parameter */
 				fprintf(stderr, "erresc: invalid color j=%d, p=%s\n",
-- 
2.34.1
Received on Mon Dec 27 2021 - 10:47:56 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 27 2021 - 22:36:31 CET