From 204f736777e712756a3a7bf1b226f478504ce312 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Fri, 30 Jun 2017 11:17:11 +0900 Subject: [PATCH] fix backref number == 0 case --- src/regparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regparse.c b/src/regparse.c index b53f2bf..a91d95c 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -3568,9 +3568,9 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) if (num_type != IS_NOT_NUM) { if (num_type == IS_REL_NUM) { back_num = backref_rel_to_abs(back_num, env); - if (back_num <= 0) - return ONIGERR_INVALID_BACKREF; } + if (back_num <= 0) + return ONIGERR_INVALID_BACKREF; if (IS_SYNTAX_BV(syn, ONIG_SYN_STRICT_CHECK_BACKREF)) { if (back_num > env->num_mem || -- 2.40.0