8000 [2.7] bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) by izbyshev · Pull Request #10433 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[2.7] bpo-35194: Fix a wrong constant in cp932 codec (GH-10420) #10433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[2.7] 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>
  • Loading branch information
Alexey Izbyshev committed Nov 9, 2018
commit e97c147f4b77b80fce9e1791d2b4db2dfc38b807
2 changes: 1 addition & 1 deletion Modules/cjkcodecs/_codecs_jp.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ENCODER(cp932)
if (c == 0xf8f0)
OUT1(0xa0)
else
OUT1(c - 0xfef1 + 0xfd)
OUT1(c - 0xf8f1 + 0xfd)
NEXT(1, 1)
continue;
}
Expand Down
0