diff options
author | Jochen Sprickerhof <git@jochen.sprickerhof.de> | 2021-12-27 11:41:42 +0100 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2022-01-01 20:01:24 +0000 |
commit | 6a99ca4167a67165c7c07b701d773c6627ef5fbb (patch) | |
tree | cc1e84f92eca2dd6a4eb37ddccc607bd6649d1dc | |
parent | f9f6cfa2c12628aec3d4a4a131131ac0546654d1 (diff) |
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 8e31030.
-rw-r--r-- | st.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2023,10 +2023,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) |