Avoid segfault in command-modes

* src/data.c (Fcommand_modes): Check that bytecode object is
interactive before accessing its interactive spec to avoid
segfaulting (bug#50376).
This commit is contained in:
Basil L. Contovounesios 2021-09-04 17:04:26 +01:00
parent 0fe03c4740
commit 534e631b00

View file

@ -1045,6 +1045,8 @@ The value, if non-nil, is a list of mode name symbols. */)
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. */