]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : fix iterator::end() dereference (#20445)
authorMasato Nakasaka <redacted>
Mon, 16 Mar 2026 06:50:38 +0000 (23:50 -0700)
committerGitHub <redacted>
Mon, 16 Mar 2026 06:50:38 +0000 (08:50 +0200)
common/regex-partial.cpp

index e667a209e9877c978da2fce13b588b013cc5fcb4..bd9034e931922625420ff0025624c8cf3c594e00 100644 (file)
@@ -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;
                     }
                 }