diff options
| author | Basil L. Contovounesios | 2021-09-04 17:04:26 +0100 |
|---|---|---|
| committer | Basil L. Contovounesios | 2021-09-04 21:28:31 +0200 |
| commit | 534e631b00a3b065016df23aa0f6b7d043e9ed86 (patch) | |
| tree | 490c63a115a9b087d4a7370fbf5d181dbae0e53b /src/data.c | |
| parent | 0fe03c47409ebd702837fc74196d7344a916c495 (diff) | |
| download | emacs-534e631b00a3b065016df23aa0f6b7d043e9ed86.tar.gz emacs-534e631b00a3b065016df23aa0f6b7d043e9ed86.zip | |
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).
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c index ffca7e75355..27b642df286 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -1045,6 +1045,8 @@ The value, if non-nil, is a list of mode name symbols. */) | |||
| 1045 | 1045 | ||
| 1046 | if (COMPILEDP (fun)) | 1046 | if (COMPILEDP (fun)) |
| 1047 | { | 1047 | { |
| 1048 | if (PVSIZE (fun) <= COMPILED_INTERACTIVE) | ||
| 1049 | return Qnil; | ||
| 1048 | Lisp_Object form = AREF (fun, COMPILED_INTERACTIVE); | 1050 | Lisp_Object form = AREF (fun, COMPILED_INTERACTIVE); |
| 1049 | if (VECTORP (form)) | 1051 | if (VECTORP (form)) |
| 1050 | /* New form -- the second element is the command modes. */ | 1052 | /* New form -- the second element is the command modes. */ |