summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-04-24 15:47:58 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-04-24 15:47:58 (GMT)
commit9c7addd0fee93ed5ccdf1faeccf7994924e2d6ca (patch)
treec18e561084029e6193ad76d6e83304f63f9607a8 /generic/tclEncoding.c
parentf7cd99b5152a34e5eecde3de08db482435ddf2eb (diff)
downloadtcl-9c7addd0fee93ed5ccdf1faeccf7994924e2d6ca.zip
tcl-9c7addd0fee93ed5ccdf1faeccf7994924e2d6ca.tar.gz
tcl-9c7addd0fee93ed5ccdf1faeccf7994924e2d6ca.tar.bz2
Fix UtfToUtfProc() to remove the potential to read beyond end of input buffer.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 1842fb6..54a49aa 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2283,7 +2283,7 @@ UtfToUtfProc(
*dst++ = *src++;
} else if (pureNullMode == 1 && UCHAR(*src) == 0xc0 &&
- UCHAR(*(src+1)) == 0x80) {
+ (src + 1 < srcEnd) && UCHAR(*(src+1)) == 0x80) {
/*
* Convert 0xc080 to real nulls when we are in output mode.
*/