diff options
author | Neil <nyamatongwe@gmail.com> | 2013-07-15 16:29:56 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-07-15 16:29:56 +1000 |
commit | ba0ea12c0b276ef8e2159751f39d0f8654fde9d9 (patch) | |
tree | 57c6693940452e2e94182a1a75ae3e757054046c /src/CaseConvert.cxx | |
parent | a00396a70bec1bd6617cbec3b8ab88df057a6e23 (diff) | |
download | scintilla-mirror-ba0ea12c0b276ef8e2159751f39d0f8654fde9d9.tar.gz |
Fix out-of-bounds access for characters after end of set.
Diffstat (limited to 'src/CaseConvert.cxx')
-rw-r--r-- | src/CaseConvert.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx index d5419d5ce..6f43df816 100644 --- a/src/CaseConvert.cxx +++ b/src/CaseConvert.cxx @@ -397,7 +397,9 @@ public: } const char *Find(int character) { const std::vector<int>::iterator it = std::lower_bound(characters.begin(), characters.end(), character); - if (*it == character) + if (it == characters.end()) + return 0; + else if (*it == character) return conversions[it - characters.begin()].conversion; else return 0; |