summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-04-08 17:13:39 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2020-04-09 12:06:39 +0200
commit786887cf439450ce7d8d6fbe624e8c434e50d469 (patch)
treee097dce7c9f47bbc69dc0025076623ac4c014f14 /src/coding.c
parent402cbc5be26827244075dbe14288e7722290f83a (diff)
downloademacs-786887cf439450ce7d8d6fbe624e8c434e50d469.tar.gz
Don't crash with invalid argument in check-coding-systems-region
* src/coding.c (Fcheck_coding_systems_region): Don't crash if the third arg contains something that isn't a coding system. * test/src/coding-tests.el (coding-check-coding-systems-region): New test.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c
index c24c70c0899..ffcb9cf0a1a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -9302,7 +9302,10 @@ is nil. */)
for (tail = coding_system_list; CONSP (tail); tail = XCDR (tail))
{
elt = XCAR (tail);
- attrs = AREF (CODING_SYSTEM_SPEC (elt), 0);
+ Lisp_Object spec = CODING_SYSTEM_SPEC (elt);
+ if (!VECTORP (spec))
+ xsignal1 (Qcoding_system_error, elt);
+ attrs = AREF (spec, 0);
ASET (attrs, coding_attr_trans_tbl,
get_translation_table (attrs, 1, NULL));
list = Fcons (list2 (elt, attrs), list);