summaryrefslogtreecommitdiffstats
path: root/generic/tkEntry.c
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2016-08-31 08:50:23 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2016-08-31 08:50:23 (GMT)
commit649734741310284cd216cab6a64f2d1e22a3c115 (patch)
treedcdd00c2d8212b54cc23ac582b5240235882f34d /generic/tkEntry.c
parent322b9d53baf96ac29848cbecd1c7901ae311d93f (diff)
downloadtk-649734741310284cd216cab6a64f2d1e22a3c115.zip
tk-649734741310284cd216cab6a64f2d1e22a3c115.tar.gz
tk-649734741310284cd216cab6a64f2d1e22a3c115.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';
}