summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2006-06-05 00:59:54 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2006-06-05 00:59:54 (GMT)
commit58ce5bc14c514a3d7ddc06a4b57d2101104cd8aa (patch)
tree8626de4ea98163881d5c26dfe159e13949094102 /Modules/cjkcodecs
parent06c5c008193164f04ebcc14ca5176080cf303c54 (diff)
downloadcpython-58ce5bc14c514a3d7ddc06a4b57d2101104cd8aa.zip
cpython-58ce5bc14c514a3d7ddc06a4b57d2101104cd8aa.tar.gz
cpython-58ce5bc14c514a3d7ddc06a4b57d2101104cd8aa.tar.bz2
Fix a potentially invalid memory access of CJKCodecs' shift-jis
decoder. (found by Neal Norwitz)
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/_codecs_jp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/cjkcodecs/_codecs_jp.c b/Modules/cjkcodecs/_codecs_jp.c
index 9b8d324..f49a10b 100644
--- a/Modules/cjkcodecs/_codecs_jp.c
+++ b/Modules/cjkcodecs/_codecs_jp.c
@@ -639,10 +639,11 @@ DECODER(shift_jis_2004)
REQUIRE_OUTBUF(1)
JISX0201_DECODE(c, **outbuf)
else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)){
- unsigned char c1, c2 = IN2;
+ unsigned char c1, c2;
ucs4_t code;
REQUIRE_INBUF(2)
+ c2 = IN2;
if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc)
return 2;