summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-08-31 08:50:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-08-31 08:50:23 (GMT)
commit34d8945d9d1dbbb3f599cabcad75ec0305f7615d (patch)
treedcdd00c2d8212b54cc23ac582b5240235882f34d /generic/tkEntry.c
parentbdab09a0d9b8ae500789e11038ce4a96802388ec (diff)
downloadtk-34d8945d9d1dbbb3f599cabcad75ec0305f7615d.zip
tk-34d8945d9d1dbbb3f599cabcad75ec0305f7615d.tar.gz
tk-34d8945d9d1dbbb3f599cabcad75ec0305f7615d.tar.bz2
Fix use of XMaxTransChars in stead of TCL_UTF_MAX in some places. This should prevent possible buffer overflow when TCL_UTF_MAX=6
Micro-optimizations in tkEntry and ttkEntry
Diffstat (limited to 'generic/tkEntry.c')
-rw-r--r--generic/tkEntry.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index ea8d7f1..c0ce47b 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1943,7 +1943,8 @@ EntryComputeGeometry(
entryPtr->displayString = p;
for (i = entryPtr->numChars; --i >= 0; ) {
- p += Tcl_UniCharToUtf(ch, p);
+ memcpy(p, buf, size);
+ p += size;
}
*p = '\0';
}