summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2015-07-31 22:05:20 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2015-07-31 22:05:20 (GMT)
commit7239216affd24b23526c606fe0cfed2d41c7305b (patch)
treeafcf0cb47a2b1fad144ed62c1b97a8b6e6e2ed66 /unix/tclUnixInit.c
parentebfeba748ff271021528a24c0ccf6e6f279ba347 (diff)
downloadtcl-7239216affd24b23526c606fe0cfed2d41c7305b.zip
tcl-7239216affd24b23526c606fe0cfed2d41c7305b.tar.gz
tcl-7239216affd24b23526c606fe0cfed2d41c7305b.tar.bz2
fix off-by-one possible buffer overrun when looking for encodings; found by coverity
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c2
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);