From 8b8bb4ba01d9ea255db09ca0644fedf60771af3e Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 20 Feb 2017 09:46:12 +0000 Subject: regparse.c: initialize return values * regparse.c (parse_char_class): initialize return values before depth limit check. returned values will be freed in callers regardless the error. [ruby-core:79624] [Bug #13234] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'regparse.c') diff --git a/regparse.c b/regparse.c index a2d2fcf6a7..1e0dfd99bb 100644 --- a/regparse.c +++ b/regparse.c @@ -4572,11 +4572,11 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e enum CCVALTYPE val_type, in_type; int val_israw, in_israw; + *np = *asc_np = NULL_NODE; env->parse_depth++; if (env->parse_depth > ParseDepthLimit) return ONIGERR_PARSE_DEPTH_LIMIT_OVER; prev_cc = asc_prev_cc = (CClassNode* )NULL; - *np = *asc_np = NULL_NODE; r = fetch_token_in_cc(tok, src, end, env); if (r == TK_CHAR && tok->u.c == '^' && tok->escaped == 0) { neg = 1; -- cgit v1.2.3