From 117795a0594d1b4fc1c267311d789b0255ac6291 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Sun, 18 Sep 2022 07:44:23 +0200 Subject: [PATCH] Fix possible null pointer access * src/term.c (Ftty__output_buffer_size): Handle case of decode_tty_terminal returning NULL. --- src/term.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/term.c b/src/term.c index 231324d002a..f8104e0304e 100644 --- a/src/term.c +++ b/src/term.c @@ -2433,7 +2433,9 @@ A value of zero means TTY uses the system's default value. */) (Lisp_Object tty) { struct terminal *terminal = decode_tty_terminal (tty); - return make_fixnum (terminal->display_info.tty->output_buffer_size); + if (terminal) + return make_fixnum (terminal->display_info.tty->output_buffer_size); + error ("Not a tty terminal"); } -- 2.39.2