diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-07 15:57:59 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-07 16:30:34 +0200 |
commit | 5d43bdb0d19823592dddd5f27e203a54f63e1441 (patch) | |
tree | 697b3a6cc5858587f213812085b416a6e1e61067 /eval.c | |
parent | a35469d34be384d3a5ae7b852acb6d980f6b702e (diff) |
eval: fix segmentation when attempting to concat a string with null
A typo in the code lead to a null pointer dereference.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1039,7 +1039,7 @@ ut_execute_arith(struct ut_state *state, uint32_t off) (json_object_is_type(v1, json_type_string) || json_object_is_type(v2, json_type_string))) { s1 = v1 ? json_object_get_string(v1) : "null"; - s2 = v1 ? json_object_get_string(v2) : "null"; + s2 = v2 ? json_object_get_string(v2) : "null"; len1 = strlen(s1); len2 = strlen(s2); s = calloc(1, len1 + len2 + 1); |