diff options
author | Roberto E. Vargas Caballero | 2015-04-23 17:55:41 +0200 |
---|---|---|
committer | Roberto E. Vargas Caballero | 2015-04-23 17:59:10 +0200 |
commit | 0d7448dabc981716d277a5afac22fabc127bacca (patch) | |
tree | ebc634a2e64727223ab7fe5d93b61286c6071b06 | |
parent | b17aa18f7c15be8db2afd62ac696b63c75755f1c (diff) | |
download | st-0d7448dabc981716d277a5afac22fabc127bacca.tar.gz st-0d7448dabc981716d277a5afac22fabc127bacca.tar.xz st-0d7448dabc981716d277a5afac22fabc127bacca.zip |
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.
-rw-r--r-- | st.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -2268,8 +2268,7 @@ strhandle(void) { 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 */ |