From: Masato Nakasaka Date: Mon, 16 Mar 2026 06:50:38 +0000 (-0700) Subject: common : fix iterator::end() dereference (#20445) X-Git-Tag: upstream/0.0.8611~241 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=d3936498a3d8f41cdb35d9e7d04a19e704b4fc89;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : fix iterator::end() dereference (#20445) --- diff --git a/common/regex-partial.cpp b/common/regex-partial.cpp index e667a209e..bd9034e93 100644 --- a/common/regex-partial.cpp +++ b/common/regex-partial.cpp @@ -102,7 +102,7 @@ std::string regex_to_reversed_partial_regex(const std::string & pattern) { auto is_star = *it == '*'; ++it; if (is_star) { - if (*it == '?') { + if (it != end && *it == '?') { ++it; } }