summaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2011-09-02 19:19:49 -0400
committerMathias Stearn <mathias@10gen.com>2011-09-06 12:11:11 -0400
commit55ca0b16581375a014e1ccb94a7b07fa83f0658a (patch)
tree69a41c0f6e41037467170d5899cca268df581ccc /third_party
parent0568f129bd64ac09ca917e6f2718fc215d0e8719 (diff)
downloadmongo-55ca0b16581375a014e1ccb94a7b07fa83f0658a.tar.gz
Correct fix for SERVER-3394
Diffstat (limited to 'third_party')
-rw-r--r--third_party/linenoise/linenoise.cpp2
1 files changed, 1 insertions, 1 deletions
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--;