From 55ca0b16581375a014e1ccb94a7b07fa83f0658a Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 2 Sep 2011 19:19:49 -0400 Subject: Correct fix for SERVER-3394 --- third_party/linenoise/linenoise.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/linenoise/linenoise.cpp b/third_party/linenoise/linenoise.cpp index 6a9ed51345f..3969f768f03 100644 --- a/third_party/linenoise/linenoise.cpp +++ b/third_party/linenoise/linenoise.cpp @@ -281,7 +281,7 @@ static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_ if (scanDirection) { int unmatched = scanDirection; int i; - for(i = pos + scanDirection; i >= 0 && buf[i]; i += scanDirection){ + for(i = pos + scanDirection; i >= 0 && i <= (int)len; i += scanDirection){ /* TODO: the right thing when inside a string */ if (strchr("}])", buf[i])) unmatched--; -- cgit v1.2.1