diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-08-31 08:55:32 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-08-31 08:55:32 (GMT) |
commit | 424428fd6bc5205a89e05a7c3ce3ae1abb58e9f7 (patch) | |
tree | b89107a81aaee65f22938a9b9f99531a9877eefd /unix/tkUnixSelect.c | |
parent | 3b59770739821e36c3f5557ecfaae082b66f4322 (diff) | |
parent | ea6b35b21034a7ccfb568ab20f1c850b5619b8a7 (diff) | |
download | tk-424428fd6bc5205a89e05a7c3ce3ae1abb58e9f7.zip tk-424428fd6bc5205a89e05a7c3ce3ae1abb58e9f7.tar.gz tk-424428fd6bc5205a89e05a7c3ce3ae1abb58e9f7.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 'unix/tkUnixSelect.c')
-rw-r--r-- | unix/tkUnixSelect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c index 4bb462e..53275d1 100644 --- a/unix/tkUnixSelect.c +++ b/unix/tkUnixSelect.c @@ -21,7 +21,7 @@ typedef struct ConvertInfo { * offset of the next chunk of data to * transfer. */ Tcl_EncodingState state; /* The encoding state needed across chunks. */ - char buffer[TCL_UTF_MAX]; /* A buffer to hold part of a UTF character + char buffer[4]; /* A buffer to hold part of a UTF character * that is split across chunks.*/ } ConvertInfo; @@ -439,7 +439,7 @@ TkSelPropProc( * Preserve any left-over bytes. */ - if (srcLen > TCL_UTF_MAX) { + if (srcLen > 4) { Tcl_Panic("selection conversion left too many bytes unconverted"); } memcpy(incrPtr->converts[i].buffer, src, (size_t) srcLen+1); |