From 82295328ccf6f5ad2ec961307daecba60969c8c5 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 1 Sep 2015 14:44:30 +0200 Subject: [PATCH] Test for end() after lower_bound call before dereferencing! --HG-- branch : WINDOWSPORT --- src/common/textsplit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/textsplit.cpp b/src/common/textsplit.cpp index 6807a7a2..f9dc87e1 100644 --- a/src/common/textsplit.cpp +++ b/src/common/textsplit.cpp @@ -142,6 +142,8 @@ static inline int whatcc(unsigned int c) } else { vector::iterator it = lower_bound(vpuncblocks.begin(), vpuncblocks.end(), c); + if (it == vpuncblocks.end()) + return LETTER; if (c == *it) return SPACE; if ((it - vpuncblocks.begin()) % 2 == 1) {