Avoid crashes in coding_inherit_eol_type
* src/coding.c (coding_inherit_eol_type): Check the validity of the arguments. Suggested by Andreas Schwab <schwab@linux-m68k.org>. (Bug#21602)
This commit is contained in:
parent
265d525a5e
commit
272ca09635
1 changed files with 2 additions and 0 deletions
|
@ -6004,6 +6004,7 @@ coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent)
|
|||
|
||||
if (NILP (coding_system))
|
||||
coding_system = Qraw_text;
|
||||
CHECK_CODING_SYSTEM (coding_system);
|
||||
spec = CODING_SYSTEM_SPEC (coding_system);
|
||||
eol_type = AREF (spec, 2);
|
||||
if (VECTORP (eol_type))
|
||||
|
@ -6014,6 +6015,7 @@ coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent)
|
|||
{
|
||||
Lisp_Object parent_spec;
|
||||
|
||||
CHECK_CODING_SYSTEM (parent);
|
||||
parent_spec = CODING_SYSTEM_SPEC (parent);
|
||||
parent_eol_type = AREF (parent_spec, 2);
|
||||
if (VECTORP (parent_eol_type))
|
||||
|
|
Loading…
Add table
Reference in a new issue