From: K.Kosako Date: Thu, 27 Sep 2018 04:39:08 +0000 (+0900) Subject: fix #121: Miss null pointer check X-Git-Tag: v6.9.1~18^2~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=396a757dffafc0c7eb269433c29a0ba961d73ad6;p=onig fix #121: Miss null pointer check --- diff --git a/src/regparse.c b/src/regparse.c index 25258c4..d95bdad 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -7713,8 +7713,9 @@ parse_exp(Node** np, OnigToken* tok, int term, UChar** src, UChar* end, case TK_ALT: case TK_EOT: end_of_token: - *np = node_new_empty(); - return tok->type; + *np = node_new_empty(); + CHECK_NULL_RETURN_MEMERR(*np); + return tok->type; break; case TK_SUBEXP_OPEN: @@ -7965,8 +7966,10 @@ parse_exp(Node** np, OnigToken* tok, int term, UChar** src, UChar* end, if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) { if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS)) return ONIGERR_TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED; - else + else { *np = node_new_empty(); + CHECK_NULL_RETURN_MEMERR(*np); + } } else { goto tk_byte;