From af9e5aef2b0fe98320d9964439d5d9dffa2d558f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 4 May 2020 20:19:24 +0200 Subject: [PATCH] csi: ignore invalid parameters in 'CSI Ps q' Before this patch, an invalid parameter would not change the cursor style, but could cause the cursor to start (or stop) blinking. --- csi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/csi.c b/csi.c index d437f5a6..eb188656 100644 --- a/csi.c +++ b/csi.c @@ -1452,12 +1452,18 @@ csi_dispatch(struct terminal *term, uint8_t final) case 6: /* steady bar */ term->cursor_style = CURSOR_BAR; break; + + default: + UNHANDLED(); + break; } - if (param == 0 || param & 1) - term_cursor_blink_enable(term); - else - term_cursor_blink_disable(term); + if (param <= 6) { + if (param == 0 || param & 1) + term_cursor_blink_enable(term); + else + term_cursor_blink_disable(term); + } break; }