From ba0ea12c0b276ef8e2159751f39d0f8654fde9d9 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 15 Jul 2013 16:29:56 +1000 Subject: Fix out-of-bounds access for characters after end of set. --- src/CaseConvert.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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::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; -- cgit v1.2.3