summaryrefslogtreecommitdiff
path: root/regparse.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-20 09:46:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-20 09:46:12 +0000
commitea940cc4dcff8d6c345d7015eda0bf06671f87e9 (patch)
tree3f80c35e0674ffb0e56ff700aafe4a05983a931c /regparse.c
parentf28de8c06a6708995c615d8d07f846bbb3cc9435 (diff)
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
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regparse.c b/regparse.c
index a2d2fcf..1e0dfd9 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;