all repos — st @ 0d7448dabc981716d277a5afac22fabc127bacca

st (suckless terminal) config

Fix segmentation fault in strhandle()

We cannot pass strescseq.args[0] to atoi when nargs is zero,
because in this case it will be null.
Roberto E. Vargas Caballero k0ga@shike2.com
commit

0d7448dabc981716d277a5afac22fabc127bacca

parent

b17aa18f7c15be8db2afd62ac696b63c75755f1c

1 files changed, 1 insertions(+), 2 deletions(-)

jump to
M st.cst.c

@@ -2268,8 +2268,7 @@ int j, narg, par;

term.esc &= ~(ESC_STR_END|ESC_STR); strparse(); - narg = strescseq.narg; - par = atoi(strescseq.args[0]); + par = (narg = strescseq.narg) ? atoi(strescseq.args[0]) : 0; switch(strescseq.type) { case ']': /* OSC -- Operating System Command */