bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) · python/cpython@7a69cf4 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 7a69cf4

Alexey Izbyshevmiss-islington

authored and

committed

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

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 1 addition & 1 deletion

Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ ENCODER(cp932)
40 40 if (c == 0xf8f0)
41 41 OUTBYTE1(0xa0);
42 42 else
43 -OUTBYTE1(c - 0xfef1 + 0xfd);
43 +OUTBYTE1(c - 0xf8f1 + 0xfd);
44 44 NEXT(1, 1);
45 45 continue;
46 46 }