diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-21 13:08:09 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-21 13:08:09 +0200 |
commit | 525a0a93eafad836b0680e1c7a9fe0f8a0387fbf (patch) | |
tree | ea82d356e9f308e0b6f0da10f09dc42d7dde02c1 /eval.c | |
parent | 64d998474dc4e0c27b6f9ffa054a556d90ff7d36 (diff) |
eval: fix potential null pointer access when computing operands
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -821,8 +821,10 @@ _ut_get_operands(struct ut_state *state, struct ut_op *op, size_t n, struct json if (child && child->is_list) v[i] = ut_execute_list(state, ut_get_off(state, child)); - else + else if (child) v[i] = ut_execute_op(state, ut_get_off(state, child)); + else + v[i] = NULL; if (ut_is_type(v[i], T_EXCEPTION)) { for (j = 0; j < i; j++) |