Skip to content

Commit

Permalink
decode: fix possible NULL dereference
Browse files Browse the repository at this point in the history
This issue was caught by CIFuzz here:
fluent/fluent-bit#7613

Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored and edsiper committed Jul 3, 2023
1 parent 4f19fd3 commit fe0ccc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmt_decode_opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ static struct cfl_variant *clone_variant(Opentelemetry__Proto__Common__V1__AnyVa
struct cfl_variant *result_instance = NULL;
int result;

if (source == NULL) {
return NULL;
}
if (source->value_case == OPENTELEMETRY__PROTO__COMMON__V1__ANY_VALUE__VALUE_STRING_VALUE) {
result_instance = cfl_variant_create_from_string(source->string_value);
}
Expand Down

0 comments on commit fe0ccc7

Please sign in to comment.