From 43a63019f5bdc627170212ec5ed8c1333ad4727b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 13 Jan 2020 19:02:55 +0000 Subject: [PATCH] Fix ldisc_send() assertion in terminal answerback. A user reports that if the ^E answerback string is configured to be empty, then causing the answerback to be sent fails the assertion in ldisc_send introduced in commit c269dd013. I thought I'd caught all of the remaining cases of this in commit 4634cd47f, but apparently not. --- terminal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index ad54463b..db397e9c 100644 --- a/terminal.c +++ b/terminal.c @@ -3406,7 +3406,8 @@ static void term_out(Terminal *term) strbuf *buf = term_input_data_from_charset( term, DEFAULT_CODEPAGE, term->answerback, term->answerbacklen); - ldisc_send(term->ldisc, buf->s, buf->len, false); + if (buf->len) + ldisc_send(term->ldisc, buf->s, buf->len, false); strbuf_free(buf); } break;