Skip to content

Instantly share code, notes, and snippets.

@hughdavenport
Created December 30, 2018 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hughdavenport/3cb40fcf956085de44bf4443c25c58fe to your computer and use it in GitHub Desktop.
Save hughdavenport/3cb40fcf956085de44bf4443c25c58fe to your computer and use it in GitHub Desktop.
diff --git a/ext/mbstring/oniguruma/regcomp.c b/ext/mbstring/oniguruma/regcomp.c
index b93ca948a7..18de3b81d8 100644
--- a/ext/mbstring/oniguruma/regcomp.c
+++ b/ext/mbstring/oniguruma/regcomp.c
@@ -476,6 +476,7 @@ compile_length_string_node(Node* node, regex_t* reg)
for (; p < sn->end; ) {
len = enclen(enc, p);
+ if (p + len > sn->end) len = sn->end - p;
if (len == prev_len) {
slen++;
}
@NOURHoot
Copy link

google Authenticator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment