aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorEli Zaretskii2015-10-03 15:39:17 +0300
committerEli Zaretskii2015-10-03 15:39:17 +0300
commit272ca096356e30c67ce337855da7531994040255 (patch)
tree63e699d453875fce903526e521d0497b77318076 /src/coding.c
parent265d525a5ef9f59a6c26d40cd560ae43c3ae1d2c (diff)
downloademacs-272ca096356e30c67ce337855da7531994040255.tar.gz
emacs-272ca096356e30c67ce337855da7531994040255.zip
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)
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index 3fc6fb684c6..d2655310cd3 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6004,6 +6004,7 @@ coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent)
6004 6004
6005 if (NILP (coding_system)) 6005 if (NILP (coding_system))
6006 coding_system = Qraw_text; 6006 coding_system = Qraw_text;
6007 CHECK_CODING_SYSTEM (coding_system);
6007 spec = CODING_SYSTEM_SPEC (coding_system); 6008 spec = CODING_SYSTEM_SPEC (coding_system);
6008 eol_type = AREF (spec, 2); 6009 eol_type = AREF (spec, 2);
6009 if (VECTORP (eol_type)) 6010 if (VECTORP (eol_type))
@@ -6014,6 +6015,7 @@ coding_inherit_eol_type (Lisp_Object coding_system, Lisp_Object parent)
6014 { 6015 {
6015 Lisp_Object parent_spec; 6016 Lisp_Object parent_spec;
6016 6017
6018 CHECK_CODING_SYSTEM (parent);
6017 parent_spec = CODING_SYSTEM_SPEC (parent); 6019 parent_spec = CODING_SYSTEM_SPEC (parent);
6018 parent_eol_type = AREF (parent_spec, 2); 6020 parent_eol_type = AREF (parent_spec, 2);
6019 if (VECTORP (parent_eol_type)) 6021 if (VECTORP (parent_eol_type))