diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2015-07-31 22:05:20 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2015-07-31 22:05:20 (GMT) |
commit | f795c9e1311790997cc6d659ebfff0c54d0a0a92 (patch) | |
tree | afcf0cb47a2b1fad144ed62c1b97a8b6e6e2ed66 /unix | |
parent | 743ef38cdc29e8283156168d9a3dfef0af5ac8ba (diff) | |
download | tcl-f795c9e1311790997cc6d659ebfff0c54d0a0a92.zip tcl-f795c9e1311790997cc6d659ebfff0c54d0a0a92.tar.gz tcl-f795c9e1311790997cc6d659ebfff0c54d0a0a92.tar.bz2 |
fix off-by-one possible buffer overrun when looking for encodings; found by coverity
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixInit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 520c8e5..5fc0035 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -602,7 +602,7 @@ SearchKnownEncodings( int left = 0; int right = sizeof(localeTable)/sizeof(LocaleTable); - while (left <= right) { + while (left < right) { int test = (left + right)/2; int code = strcmp(localeTable[test].lang, encoding); |