From 7239216affd24b23526c606fe0cfed2d41c7305b Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Fri, 31 Jul 2015 22:05:20 +0000 Subject: fix off-by-one possible buffer overrun when looking for encodings; found by coverity --- unix/tclUnixInit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v0.12