changeset 89481:4896b8834fb6

(decode_coding_sjis): Check bytes more rigidly.
author Kenichi Handa <handa@m17n.org>
date Wed, 09 Jul 2003 02:16:17 +0000
parents 1640e9f749e1
children b875692f1ec6
files src/coding.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Wed Jul 09 02:15:52 2003 +0000
+++ b/src/coding.c	Wed Jul 09 02:16:17 2003 +0000
@@ -3987,12 +3987,14 @@
 		  SJIS_TO_JIS (c);
 		  charset = charset_kanji;
 		}
-	      else
+	      else if (c > 0xA0)
 		{
 		  /* SJIS -> JISX0201-Kana */
 		  c &= 0x7F;
 		  charset = charset_kana;
 		}
+	      else
+		goto invalid_code;
 	    }
 	  if (charset->id != charset_ascii
 	      && last_id != charset->id)