Skip to content

Commit 49ee41f

Browse files
miss-islingtonAlexey Izbyshev
andauthored
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 (cherry picked from commit 7a69cf4) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
1 parent 65e1a1f commit 49ee41f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)