aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2013-07-20 13:19:05 +0900
committerKenichi Handa2013-07-20 13:19:05 +0900
commit99107004b1126160d8dc69df59af03dfb62d2f54 (patch)
tree92c66e93973ff124fd91f31ede8d8461f67c6af2 /src/coding.c
parenteaaa8f3ea145176bd0168e5ed6e19044a1a9e014 (diff)
downloademacs-99107004b1126160d8dc69df59af03dfb62d2f54.tar.gz
emacs-99107004b1126160d8dc69df59af03dfb62d2f54.zip
* coding.c (CODING_ISO_FLAG_LEVEL_4): New macro.
(decode_coding_iso_2022): Check the single-shift area. (Bug#8522)
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/coding.c b/src/coding.c
index e779197bbde..ad2042672b2 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -493,6 +493,8 @@ enum iso_code_class_type
493 493
494#define CODING_ISO_FLAG_USE_OLDJIS 0x10000 494#define CODING_ISO_FLAG_USE_OLDJIS 0x10000
495 495
496#define CODING_ISO_FLAG_LEVEL_4 0x20000
497
496#define CODING_ISO_FLAG_FULL_SUPPORT 0x100000 498#define CODING_ISO_FLAG_FULL_SUPPORT 0x100000
497 499
498/* A character to be produced on output if encoding of the original 500/* A character to be produced on output if encoding of the original
@@ -3733,7 +3735,9 @@ decode_coding_iso_2022 (struct coding_system *coding)
3733 else 3735 else
3734 charset = CHARSET_FROM_ID (charset_id_2); 3736 charset = CHARSET_FROM_ID (charset_id_2);
3735 ONE_MORE_BYTE (c1); 3737 ONE_MORE_BYTE (c1);
3736 if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)) 3738 if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)
3739 || ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LEVEL_4)
3740 ? c1 >= 0x80 : c1 < 0x80))
3737 goto invalid_code; 3741 goto invalid_code;
3738 break; 3742 break;
3739 3743
@@ -3747,7 +3751,9 @@ decode_coding_iso_2022 (struct coding_system *coding)
3747 else 3751 else
3748 charset = CHARSET_FROM_ID (charset_id_3); 3752 charset = CHARSET_FROM_ID (charset_id_3);
3749 ONE_MORE_BYTE (c1); 3753 ONE_MORE_BYTE (c1);
3750 if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)) 3754 if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0)
3755 || ((CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_LEVEL_4)
3756 ? c1 >= 0x80 : c1 < 0x80))
3751 goto invalid_code; 3757 goto invalid_code;
3752 break; 3758 break;
3753 3759