Skip to content

Instantly share code, notes, and snippets.

@hughdavenport
Created December 30, 2018 22:06
Show Gist options
  • Save hughdavenport/aa428164c8f30d20c178ce0ab2907947 to your computer and use it in GitHub Desktop.
Save hughdavenport/aa428164c8f30d20c178ce0ab2907947 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..0677abf9f0 100644
--- a/ext/mbstring/oniguruma/regcomp.c
+++ b/ext/mbstring/oniguruma/regcomp.c
@@ -3391,6 +3393,7 @@ expand_case_fold_string(Node* node, regex_t* reg)
}
len = enclen(reg->enc, p);
+ if (p + len > end) len = end - p;
if (n == 0) {
if (IS_NULL(snode)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment