Commit 0d165262 authored by Alexey Izbyshev's avatar Alexey Izbyshev Committed by Serhiy Storchaka

[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 7a69cf47)
Co-authored-by: default avatarAlexey Izbyshev <izbyshev@ispras.ru>
parent 18ba4851
......@@ -40,7 +40,7 @@ ENCODER(cp932)
if (c == 0xf8f0)
OUT1(0xa0)
else
OUT1(c - 0xfef1 + 0xfd)
OUT1(c - 0xf8f1 + 0xfd)
NEXT(1, 1)
continue;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment