diff options
| author | Mattias EngdegÄrd | 2020-04-08 17:13:39 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2020-04-09 12:06:39 +0200 |
| commit | 786887cf439450ce7d8d6fbe624e8c434e50d469 (patch) | |
| tree | e097dce7c9f47bbc69dc0025076623ac4c014f14 /src/coding.c | |
| parent | 402cbc5be26827244075dbe14288e7722290f83a (diff) | |
| download | emacs-786887cf439450ce7d8d6fbe624e8c434e50d469.tar.gz emacs-786887cf439450ce7d8d6fbe624e8c434e50d469.zip | |
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.c | 5 |
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. */) | |||
| 9302 | for (tail = coding_system_list; CONSP (tail); tail = XCDR (tail)) | 9302 | for (tail = coding_system_list; CONSP (tail); tail = XCDR (tail)) |
| 9303 | { | 9303 | { |
| 9304 | elt = XCAR (tail); | 9304 | elt = XCAR (tail); |
| 9305 | attrs = AREF (CODING_SYSTEM_SPEC (elt), 0); | 9305 | Lisp_Object spec = CODING_SYSTEM_SPEC (elt); |
| 9306 | if (!VECTORP (spec)) | ||
| 9307 | xsignal1 (Qcoding_system_error, elt); | ||
| 9308 | attrs = AREF (spec, 0); | ||
| 9306 | ASET (attrs, coding_attr_trans_tbl, | 9309 | ASET (attrs, coding_attr_trans_tbl, |
| 9307 | get_translation_table (attrs, 1, NULL)); | 9310 | get_translation_table (attrs, 1, NULL)); |
| 9308 | list = Fcons (list2 (elt, attrs), list); | 9311 | list = Fcons (list2 (elt, attrs), list); |