diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-10-02 20:53:54 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-10-02 20:53:54 +0200 |
commit | 459d6f199a8e0866a4619826cadae9a23b9efa30 (patch) | |
tree | 44dc6ec1dda7e9327a442ae37a7865258879dfe3 /eval.c | |
parent | fb2056c6f5c3dcbf2cd44518a7c658471607bb2d (diff) |
eval: fix potential uninitialized memory access in ut_getref()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -288,6 +288,9 @@ ut_getref(struct ut_state *state, uint32_t off, struct json_object **key) struct json_object *val, *scope, *next; uint8_t i; + if (key) + *key = NULL; + if (op && op->type == T_DOT) { if (key) *key = off2 ? json_object_get(ut_get_op(state, off2)->val) : NULL; |