Skip to content

Instantly share code, notes, and snippets.

@hughdavenport
Created December 31, 2018 01:22
Show Gist options
  • Save hughdavenport/09b48d4b20a28bcd7afaa530e2ec6731 to your computer and use it in GitHub Desktop.
Save hughdavenport/09b48d4b20a28bcd7afaa530e2ec6731 to your computer and use it in GitHub Desktop.
diff --git a/ext/mbstring/oniguruma/regparse.c b/ext/mbstring/oniguruma/regparse.c
index d2925f1e81..17535d16bc 100644
--- a/ext/mbstring/oniguruma/regparse.c
+++ b/ext/mbstring/oniguruma/regparse.c
@@ -3581,6 +3590,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
}
else { /* string */
p = tok->backp + enclen(enc, tok->backp);
+ if (p > end) p = end;
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment