From: K.Kosako Date: Fri, 26 Aug 2016 15:35:42 +0000 (+0900) Subject: fix out of bounds read by /\k'-/ X-Git-Tag: v6.1.0~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=562bf4825b301693180c674994bf708b28b00592;p=onig fix out of bounds read by /\k'-/ --- diff --git a/src/regparse.c b/src/regparse.c index 5716d99..1b1427e 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -2473,6 +2473,10 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end, int level; int flag = (c == '-' ? -1 : 1); + if (PEND) { + r = ONIGERR_INVALID_CHAR_IN_GROUP_NAME; + goto end; + } PFETCH(c); if (! ONIGENC_IS_CODE_DIGIT(enc, c)) goto err; PUNFETCH;