]> granicus.if.org Git - onig/commitdiff
don't allow (?y{g}) for non Unicode encodings
authorK.Kosako <kkosako0@gmail.com>
Thu, 28 Mar 2019 05:39:34 +0000 (14:39 +0900)
committerK.Kosako <kkosako0@gmail.com>
Thu, 28 Mar 2019 05:39:34 +0000 (14:39 +0900)
src/regparse.c

index 13d32a9184102dff04b04cc184d5f6dce51d3430..bb3a75dd73db751c1c2b0cc22c6ad276e3ddf8a8 100644 (file)
@@ -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;