From: K.Kosako Date: Thu, 8 Feb 2018 04:23:33 +0000 (+0900) Subject: fix infinite loop in str_reduce_to_single_byte_code() X-Git-Tag: v6.8.0~343 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab17bd44b2d3d5b1307181fa37c204288f7bfadd;p=onig fix infinite loop in str_reduce_to_single_byte_code() --- diff --git a/src/regparse.c b/src/regparse.c index 0c17ff0..e6a48b3 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -394,6 +394,7 @@ str_reduce_to_single_byte_code(OnigEncoding enc, UChar* s, UChar* end, while (p < end) { n = ONIGENC_MBC_ENC_LEN(enc, p); if (n > 1) break; + p += n; } if (n < 2) { @@ -6116,7 +6117,7 @@ parse_callout_of_name(Node** np, int cterm, UChar** src, UChar* end, ScanEnv* en if (c != cterm) return ONIGERR_INVALID_CALLOUT_PATTERN; - r = onig_get_callout_id_from_name(env->enc, name_start, name_end, &id); + r = onig_get_callout_id_from_name(enc, name_start, name_end, &id); if (r != ONIG_NORMAL) return r; r = node_new_callout(np, CALLOUT_OF_NAME, id, dirs, env);