From: K.Kosako Date: Thu, 28 Mar 2019 05:39:34 +0000 (+0900) Subject: don't allow (?y{g}) for non Unicode encodings X-Git-Tag: v6.9.2_rc1~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e75d75278a27667b3f25186b9a9187cc947a5e52;p=onig don't allow (?y{g}) for non Unicode encodings --- diff --git a/src/regparse.c b/src/regparse.c index 13d32a9..bb3a75d 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -7493,6 +7493,9 @@ parse_bag(Node** np, PToken* tok, int term, UChar** src, UChar* end, PFETCH(c); switch (c) { case 'g': + if (! ONIGENC_IS_UNICODE_ENCODING(enc)) + return ONIGERR_UNDEFINED_GROUP_OPTION; + OPTION_NEGATE(option, ONIG_OPTION_TEXT_SEGMENT_EXTENDED_GRAPHEME_CLUSTER, 0); OPTION_NEGATE(option, ONIG_OPTION_TEXT_SEGMENT_WORD, 1); break;