summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2018-11-10 08:47:12 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2018-11-10 07:47:12 +0200
commit0d165262d949440e5aea6533b10e19e4cd5cf12d (patch)
tree6de06d25047bccf6f02a0a1a173e8eadac86dfe9 /Modules
parent18ba4851aeb5dc5d6b4d22adc8d0555d0c2fdfe5 (diff)
downloadcpython-git-0d165262d949440e5aea6533b10e19e4cd5cf12d.tar.gz
[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 7a69cf47a9bbc95f95fd67c982bff121b2a903cb) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cjkcodecs/_codecs_jp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c
index a05e01b32e..3acd19e625 100644
--- a/Modules/cjkcodecs/_codecs_jp.c
+++ b/Modules/cjkcodecs/_codecs_jp.c
@@ -40,7 +40,7 @@ ENCODER(cp932)
if (c == 0xf8f0)
OUT1(0xa0)
else
- OUT1(c - 0xfef1 + 0xfd)
+ OUT1(c - 0xf8f1 + 0xfd)
NEXT(1, 1)
continue;
}