From 55489ea3235da7ea22d2ded9500d2c7d492a61ba Mon Sep 17 00:00:00 2001 From: tabudz Date: Fri, 28 Feb 2025 22:29:03 +0800 Subject: [PATCH] Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) --- scintilla/oniguruma/src/regcomp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/scintilla/oniguruma/src/regcomp.c b/scintilla/oniguruma/src/regcomp.c index 10da9c442..8315b4422 100644 --- a/scintilla/oniguruma/src/regcomp.c +++ b/scintilla/oniguruma/src/regcomp.c @@ -1150,6 +1150,7 @@ compile_string_node(Node* node, regex_t* reg) for (; p < end; ) { len = enclen(enc, p); + if (p + len > end) len = end - p; if (len == prev_len) { slen++; }