summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorGerd Möllmann <gerd@gnu.org>2022-09-18 07:44:23 +0200
committerGerd Möllmann <gerd@gnu.org>2022-09-18 07:44:23 +0200
commit117795a0594d1b4fc1c267311d789b0255ac6291 (patch)
tree5f0bed32527353ce669d51f8310bbfccc28b8f5f /src/term.c
parent2f08c85d52fb1b7ef92a97bcc93a1997b4d02384 (diff)
downloademacs-117795a0594d1b4fc1c267311d789b0255ac6291.tar.gz
Fix possible null pointer access
* src/term.c (Ftty__output_buffer_size): Handle case of decode_tty_terminal returning NULL.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c4
1 files changed, 3 insertions, 1 deletions
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");
}