summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-04-24 15:48:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-04-24 15:48:56 (GMT)
commitd5453f4a90c64ff9ea80c89e8e7c4b51e7f26d16 (patch)
tree4039637916184060e9eec1a5154695b3d4ed5a64 /generic/tclEncoding.c
parentddd3275d7c30ea02bdff86cd55edc4f7c9e7babc (diff)
parent9c7addd0fee93ed5ccdf1faeccf7994924e2d6ca (diff)
downloadtcl-d5453f4a90c64ff9ea80c89e8e7c4b51e7f26d16.zip
tcl-d5453f4a90c64ff9ea80c89e8e7c4b51e7f26d16.tar.gz
tcl-d5453f4a90c64ff9ea80c89e8e7c4b51e7f26d16.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 179ca17..a7ef199 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2334,7 +2334,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.
*/