st
simple terminal
git clone https://9o.is/git/st.git
commit bee37615c1aaabfef11230a5f3518cc589a700f5 parent 5fbab945ac0129cfde3a6995189084572132612f Author: Jochen Sprickerhof <git@jochen.sprickerhof.de> Date: Mon, 27 Dec 2021 11:41:42 +0100 Fix null pointer access in strhandle According to the spec the argument is optional for 104, so p can be NULL as can be tested with printf '\x1b]104\x07'. This is a regression of f89c05f. Diffstat:
| M | st.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/st.c b/st.c @@ -1960,10 +1960,10 @@ strhandle(void) break; p = strescseq.args[2]; /* FALLTHROUGH */ - case 104: /* color reset, here p = NULL */ + case 104: /* color reset */ j = (narg > 1) ? atoi(strescseq.args[1]) : -1; - if (!strcmp(p, "?")) + if (p && !strcmp(p, "?")) osc4_color_response(j); else if (xsetcolorname(j, p)) { if (par == 104 && narg <= 1)