diff options
author | nicm <nicm> | 2020-10-29 16:33:01 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2020-10-30 08:17:38 +0000 |
commit | 733abfcfc5b05cb3e1f2cf08f00a9325c6f6fa04 (patch) | |
tree | 283e6b41f16c881754984b4db8f21379867c9af9 | |
parent | 7a4aa146187cc60d2df66333b3e7dd5a5176f793 (diff) | |
download | rtmux-733abfcfc5b05cb3e1f2cf08f00a9325c6f6fa04.tar.gz rtmux-733abfcfc5b05cb3e1f2cf08f00a9325c6f6fa04.tar.bz2 rtmux-733abfcfc5b05cb3e1f2cf08f00a9325c6f6fa04.zip |
Do not write after the end of the array and overwrite the stack when
colon-separated SGR sequences contain empty arguments. Reported by Sergey
Nizovtsev.
-rw-r--r-- | input.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1975,8 +1975,13 @@ input_csi_dispatch_sgr_colon(struct input_ctx *ictx, u_int i) free(copy); return; } - } else + } else { n++; + if (n == nitems(p)) { + free(copy); + return; + } + } log_debug("%s: %u = %d", __func__, n - 1, p[n - 1]); } free(copy); |