summaryrefslogtreecommitdiffhomepage
path: root/eval.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-10-02 20:53:54 +0200
committerJo-Philipp Wich <jo@mein.io>2020-10-02 20:53:54 +0200
commit459d6f199a8e0866a4619826cadae9a23b9efa30 (patch)
tree44dc6ec1dda7e9327a442ae37a7865258879dfe3 /eval.c
parentfb2056c6f5c3dcbf2cd44518a7c658471607bb2d (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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index a54e993..caa46d6 100644
--- a/eval.c
+++ b/eval.c
@@ -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;