Skip to content

Commit 7a69cf4

Browse files
Alexey Izbyshevmiss-islington
authored andcommitted
bpo-35194: Fix a wrong constant in cp932 codec (GH-10420)
This typo doesn't affect the result because wrong bits are discarded on implicit conversion to unsigned char, but it trips UBSan with -fsanitize=implicit-integer-truncation. https://bugs.python.org/issue35194
1 parent 0f221d0 commit 7a69cf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/cjkcodecs/_codecs_jp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ENCODER(cp932)
4040
if (c == 0xf8f0)
4141
OUTBYTE1(0xa0);
4242
else
43-
OUTBYTE1(c - 0xfef1 + 0xfd);
43+
OUTBYTE1(c - 0xf8f1 + 0xfd);
4444
NEXT(1, 1);
4545
continue;
4646
}

0 commit comments

Comments
 (0)