8000 [2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-… · python/cpython@0d16526 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 0d16526

Browse files
Alexey Izbyshevserhiy-storchaka
Alexey Izbyshev
authored andcommitted
[2.7] bpo-35194: Fix a wrong constant in cp932 codec. (GH-10420) (GH-10433)
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. (cherry picked from commit 7a69cf4) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
1 parent 18ba485 commit 0d16526

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
OUT1(0xa0)
4242
else
43-
OUT1(c - 0xfef1 + 0xfd)
43+
OUT1(c - 0xf8f1 + 0xfd)
4444
NEXT(1, 1)
4545
continue;
4646
}

0 commit comments

Comments
 (0)
0