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

Serhiy Storchaka webhook-mailer at python.org
Sat Nov 10 00:47:15 EST 2018


https://github.com/python/cpython/commit/0d165262d949440e5aea6533b10e19e4cd5cf12d
commit: 0d165262d949440e5aea6533b10e19e4cd5cf12d
branch: 2.7
author: Alexey Izbyshev <izbyshev at ispras.ru>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2018年11月10日T07:47:12+02:00
summary:
[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 at ispras.ru>
files:
M Modules/cjkcodecs/_codecs_jp.c
diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c
index a05e01b32e5a..3acd19e6258e 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;
 }


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /