From: Mikko Rasa Date: Wed, 1 Sep 2021 00:13:05 +0000 (+0300) Subject: Don't access iterator if it's at end X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c2530205a67e5d0b341827287151978652b91aaa;p=libs%2Fcore.git Don't access iterator if it's at end --- diff --git a/source/strings/regex.cpp b/source/strings/regex.cpp index 832cd85..c624056 100644 --- a/source/strings/regex.cpp +++ b/source/strings/regex.cpp @@ -130,7 +130,8 @@ Regex::Code Regex::compile(const string &expr, string::const_iterator &iter, uns Count repeat_min = 1; Count repeat_max = 1; - parse_repeat(expr, i, repeat_min, repeat_max); + if(i!=end) + parse_repeat(expr, i, repeat_min, repeat_max); for(unsigned j=0; j