From: K.Kosako Date: Tue, 2 Oct 2018 04:17:15 +0000 (+0900) Subject: fix confusion of ONIG_CHAR_TABLE_SIZE X-Git-Tag: v6.9.1~18^2~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e944b31ae1da2da5e56d3bebf267ab3939593563;p=onig fix confusion of ONIG_CHAR_TABLE_SIZE --- diff --git a/src/regcomp.c b/src/regcomp.c index ab95d12..9263863 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -4651,7 +4651,7 @@ set_sunday_quick_search_skip_table(regex_t* reg, int case_expand, } len = (int )(end - s); - if (len + offset >= ONIG_CHAR_TABLE_SIZE) + if (len + offset >= UCHAR_MAX) return ONIGERR_PARSER_BUG; *roffset = offset; @@ -4696,7 +4696,7 @@ set_bmh_search_skip_table(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, int i, len; len = (int )(end - s); - if (len < ONIG_CHAR_TABLE_SIZE) { + if (len < UCHAR_MAX) { for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) skip[i] = len; for (i = 0; i < len - 1; i++) @@ -4713,7 +4713,7 @@ set_bmh_search_skip_table(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED, #define OPT_EXACT_MAXLEN 24 -#if OPT_EXACT_MAXLEN >= ONIG_CHAR_TABLE_SIZE +#if OPT_EXACT_MAXLEN >= UCHAR_MAX #error Too big OPT_EXACT_MAXLEN #endif