diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-08-31 08:50:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-08-31 08:50:23 (GMT) |
commit | ea6b35b21034a7ccfb568ab20f1c850b5619b8a7 (patch) | |
tree | dcdd00c2d8212b54cc23ac582b5240235882f34d /generic/ttk | |
parent | be848ca8401774a0242312db38ec6505dee6190a (diff) | |
download | tk-ea6b35b21034a7ccfb568ab20f1c850b5619b8a7.zip tk-ea6b35b21034a7ccfb568ab20f1c850b5619b8a7.tar.gz tk-ea6b35b21034a7ccfb568ab20f1c850b5619b8a7.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/ttk')
-rw-r--r-- | generic/ttk/ttkEntry.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index f395649..533637d 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -290,7 +290,8 @@ static char *EntryDisplayString(const char *showChar, int numChars) p = displayString = ckalloc(numChars * size + 1); while (numChars--) { - p += Tcl_UniCharToUtf(ch, p); + memcpy(p, buf, size); + p += size; } *p = '\0'; |