Skip to content

Commit

Permalink
parser: json: fix type confusion bug (#3417)
Browse files Browse the repository at this point in the history
Signed-off-by: davkor <[email protected]>
  • Loading branch information
DavidKorczynski authored Apr 26, 2021
1 parent 9c992e4 commit 6e6cb84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/flb_parser_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ int flb_parser_json_do(struct flb_parser *parser,
return *out_size;
}

/* Ensure we have an accurate type */
if (v->type != MSGPACK_OBJECT_STR) {
msgpack_unpacked_destroy(&result);
return *out_size;
}

/* Lookup time */
ret = flb_parser_time_lookup(v->via.str.ptr, v->via.str.size,
0, parser, &tm, &tmfrac);
Expand Down

0 comments on commit 6e6cb84

Please sign in to comment.