From adb0fd12f5e7de14c62f5979bf68557ad151fbb9 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 5 Mar 2023 13:23:24 +0000 Subject: [PATCH] term_init(): initialise term->ldisc. In live uses of Terminal, we always give it an ldisc almost immediately after creating it. But the new test_terminal program doesn't, which allows it to be an uninitialised pointer. Apparently I got lucky while testing this the first few times. --- terminal/terminal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/terminal/terminal.c b/terminal/terminal.c index f1757c7d..4049e98e 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -2064,6 +2064,7 @@ Terminal *term_init(Conf *myconf, struct unicode_data *ucsdata, TermWin *win) term->paste_len = 0; bufchain_init(&term->inbuf); bufchain_init(&term->printer_buf); + term->ldisc = NULL; term->printing = term->only_printing = false; term->print_job = NULL; term->vt52_mode = false;