From f99164ce3a1c906ec9a7ff893bf4d3e895b9e3f4 Mon Sep 17 00:00:00 2001 From: tomo Date: Sat, 13 Nov 1999 21:52:20 +0000 Subject: [PATCH] (Fput_char_attribute): Check each element of VALUE is a byte if ATTRIBUTE is a coded-charset or its name. --- src/mule-charset.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mule-charset.c b/src/mule-charset.c index 6daf6af..d093f54 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -571,9 +571,11 @@ Store CHARACTER's ATTRIBUTE with VALUE. Lisp_Object ei = Fcar (rest); if (!INTP (ei)) - signal_simple_error ("Invalid value for coded-charset", - value); - i = XINT (ei) - XCHARSET_BYTE_OFFSET (ccs); + signal_simple_error ("Invalid value for coded-charset", value); + i = XINT (ei); + if ((i < 0) || (255 < i)) + signal_simple_error ("Invalid value for coded-charset", value); + i -= XCHARSET_BYTE_OFFSET (ccs); nv = XVECTOR_DATA(v)[i]; rest = Fcdr (rest); if (CONSP (rest)) -- 1.7.10.4