Skip to content

Commit b29baa5

Browse files
author
Moriyoshi Koizumi
committed
- Fix bug #47399 (mb_check_encoding() returns true for some illegal SJIS
characters).
1 parent d2b80c9 commit b29baa5

File tree

3 files changed

+525
-2
lines changed

3 files changed

+525
-2
lines changed

ext/mbstring/libmbfl/filters/mbfilter_cp932.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ mbfl_filt_conv_sjiswin_wchar(int c, mbfl_convert_filter *filter)
167167
case 1: /* kanji second char */
168168
filter->status = 0;
169169
c1 = filter->cache;
170-
if (c > 0x39 && c < 0xfd && c != 0x7f) {
170+
if (c >= 0x40 && c <= 0xfc && c != 0x7f) {
171171
w = 0;
172172
SJIS_DECODE(c1, c, s1, s2);
173173
s = (s1 - 0x21)*94 + s2 - 0x21;

ext/mbstring/libmbfl/filters/mbfilter_sjis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ mbfl_filt_conv_sjis_wchar(int c, mbfl_convert_filter *filter)
167167
case 1: /* kanji second char */
168168
filter->status = 0;
169169
c1 = filter->cache;
170-
if (c > 0x39 && c < 0xfd && c != 0x7f) {
170+
if (c >= 0x40 && c <= 0xfc && c != 0x7f) {
171171
SJIS_DECODE(c1, c, s1, s2);
172172
w = (s1 - 0x21)*94 + s2 - 0x21;
173173
if (w >= 0 && w < jisx0208_ucs_table_size) {

0 commit comments

Comments
 (0)