changeset 30578:705b94e152b1

(decode_coding_iso2022): More strict check for handling single shifting.
author Kenichi Handa <handa@m17n.org>
date Fri, 04 Aug 2000 02:05:39 +0000
parents c4e04757698b
children 13339fe0bdc0
files src/coding.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Fri Aug 04 02:05:08 2000 +0000
+++ b/src/coding.c	Fri Aug 04 02:05:39 2000 +0000
@@ -1471,6 +1471,8 @@
 		goto label_invalid_code;
 	      charset = CODING_SPEC_ISO_DESIGNATION (coding, 2);
 	      ONE_MORE_BYTE (c1);
+	      if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
+		goto label_invalid_code;
 	      break;
 
 	    case 'O':		/* invocation of single-shift-3 */
@@ -1479,6 +1481,8 @@
 		goto label_invalid_code;
 	      charset = CODING_SPEC_ISO_DESIGNATION (coding, 3);
 	      ONE_MORE_BYTE (c1);
+	      if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
+		goto label_invalid_code;
 	      break;
 
 	    case '0': case '2':	case '3': case '4': /* start composition */