From: K.Kosako Date: Tue, 10 Apr 2018 04:34:46 +0000 (+0900) Subject: fix invalid return values in onig_get_args_num_by_callout_args() etc.. X-Git-Tag: v6.8.2^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62d0949a4a927292aec468c3609d53fbf7a05333;p=onig fix invalid return values in onig_get_args_num_by_callout_args() etc.. --- diff --git a/src/regexec.c b/src/regexec.c index 24a918c..1ec5183 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -5173,7 +5173,7 @@ onig_get_args_num_by_callout_args(OnigCalloutArgs* args) num = args->num; e = onig_reg_callout_list_at(args->regex, num); - if (IS_NULL(e)) return 0; + if (IS_NULL(e)) return ONIGERR_INVALID_ARGUMENT; if (e->of == ONIG_CALLOUT_OF_NAME) { return e->u.arg.num; } @@ -5189,7 +5189,7 @@ onig_get_passed_args_num_by_callout_args(OnigCalloutArgs* args) num = args->num; e = onig_reg_callout_list_at(args->regex, num); - if (IS_NULL(e)) return 0; + if (IS_NULL(e)) return ONIGERR_INVALID_ARGUMENT; if (e->of == ONIG_CALLOUT_OF_NAME) { return e->u.arg.passed_num; } @@ -5206,7 +5206,7 @@ onig_get_arg_by_callout_args(OnigCalloutArgs* args, int index, num = args->num; e = onig_reg_callout_list_at(args->regex, num); - if (IS_NULL(e)) return 0; + if (IS_NULL(e)) return ONIGERR_INVALID_ARGUMENT; if (e->of == ONIG_CALLOUT_OF_NAME) { if (IS_NOT_NULL(type)) *type = e->u.arg.types[index]; if (IS_NOT_NULL(val)) *val = e->u.arg.vals[index];