summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2018-11-09 07:12:06 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-11-09 07:12:06 (GMT)
commit7a69cf47a9bbc95f95fd67c982bff121b2a903cb (patch)
tree419c9be853df32f31ae559abc448ebde4bc3ba11
parent0f221d09cad46bee38d1b7a7822772df66c53028 (diff)
downloadcpython-7a69cf47a9bbc95f95fd67c982bff121b2a903cb.zip
cpython-7a69cf47a9bbc95f95fd67c982bff121b2a903cb.tar.gz
cpython-7a69cf47a9bbc95f95fd67c982bff121b2a903cb.tar.bz2
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
-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 2c7788a..3a33295 100644
--- a/Modules/cjkcodecs/_codecs_jp.c
+++ b/Modules/cjkcodecs/_codecs_jp.c
@@ -40,7 +40,7 @@ ENCODER(cp932)
if (c == 0xf8f0)
OUTBYTE1(0xa0);
else
- OUTBYTE1(c - 0xfef1 + 0xfd);
+ OUTBYTE1(c - 0xf8f1 + 0xfd);
NEXT(1, 1);
continue;
}