From cad94dbe222bb3337bfabefb66d5fb05d28dc133 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 5 Sep 2014 04:42:09 +0000 Subject: merge r46831 partially. these changes are from: https://github.com/k-takata/Onigmo/commit/7abd7b29481f98eb92be786e3d33611fc7d000a0 [Bug #8716] * include/ruby/oniguruma.h (ONIG_MAX_CAPTURE_GROUP_NUM, ONIGERR_TOO_MANY_CAPTURE_GROUPS): add cheking the number of capture groups. * regerror.c (onig_error_code_to_format): ditto. * regparse.c (scan_env_add_mem_entry): ditto. * regexec.c (onig_region_copy, match_at): fix: segmation fault occurs when many groups are used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/oniguruma.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/ruby') diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h index 0b645bd935..cdc4382596 100644 --- a/include/ruby/oniguruma.h +++ b/include/ruby/oniguruma.h @@ -340,6 +340,7 @@ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p)); /* config parameters */ #define ONIG_NREGION 10 #define ONIG_MAX_BACKREF_NUM 1000 +#define ONIG_MAX_CAPTURE_GROUP_NUM 32767 #define ONIG_MAX_REPEAT_NUM 100000 #define ONIG_MAX_MULTI_BYTE_RANGES_NUM 10000 /* constants */ @@ -584,6 +585,7 @@ ONIG_EXTERN const OnigSyntaxType* OnigDefaultSyntax; #define ONIGERR_NEVER_ENDING_RECURSION -221 #define ONIGERR_GROUP_NUMBER_OVER_FOR_CAPTURE_HISTORY -222 #define ONIGERR_INVALID_CHAR_PROPERTY_NAME -223 +#define ONIGERR_TOO_MANY_CAPTURE_GROUPS -224 #define ONIGERR_INVALID_CODE_POINT_VALUE -400 #define ONIGERR_INVALID_WIDE_CHAR_VALUE -400 #define ONIGERR_TOO_BIG_WIDE_CHAR_VALUE -401 -- cgit v1.2.3