From 68b4b03042c50cc6e7111919aaa4bae3c6e1fb47 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 4 Sep 2021 17:04:26 +0100 Subject: [PATCH] Avoid segfault in command-modes * src/data.c (Fcommand_modes): Check that bytecode object is interactive before accessing its interactive spec to avoid segfaulting. --- src/data.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data.c b/src/data.c index ffca7e7535..27b642df28 100644 --- a/src/data.c +++ b/src/data.c @@ -1045,6 +1045,8 @@ DEFUN ("command-modes", Fcommand_modes, Scommand_modes, 1, 1, 0, if (COMPILEDP (fun)) { + if (PVSIZE (fun) <= COMPILED_INTERACTIVE) + return Qnil; Lisp_Object form = AREF (fun, COMPILED_INTERACTIVE); if (VECTORP (form)) /* New form -- the second element is the command modes. */ -- 2.33.0