diff -Nurpd a/regparse.c b/regparse.c --- a/regparse.c 2020-04-03 10:48:05.349134180 -0700 +++ b/regparse.c 2020-04-03 10:55:16.647309795 -0700 @@ -4412,9 +4412,11 @@ next_state_val(CClassNode* cc, OnigCodeP switch (*state) { case CCS_VALUE: - if (*type == CCV_SB) + if (*type == CCV_SB) { + if (*from > 0xff) + return ONIGERR_INVALID_CODE_POINT_VALUE; BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*vs)); - else if (*type == CCV_CODE_POINT) { + } else if (*type == CCV_CODE_POINT) { r = add_code_range(&(cc->mbuf), env, *vs, *vs); if (r < 0) return r; }