aboutsummaryrefslogtreecommitdiffstats
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
commit8b8bb4ba01d9ea255db09ca0644fedf60771af3e (patch)
tree3f80c35e0674ffb0e56ff700aafe4a05983a931c /regparse.c
parentaa60683970ed49fb2ec61790fb873f4b44569f19 (diff)
downloadruby-8b8bb4ba01d9ea255db09ca0644fedf60771af3e.tar.gz
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 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;