Skip to content

Commit

Permalink
encode_msgpack: Fix null-dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidKorczynski committed Oct 20, 2023
1 parent f2dbc3f commit cdc0e31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ctr_encode_msgpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ static void pack_scope_spans(mpack_writer_t *writer, struct cfl_list *scope_span

/* scope */
mpack_write_cstr(writer, "scope");
pack_instrumentation_scope(writer, scope_span->instrumentation_scope);
if (scope_span->instrumentation_scope != NULL) {
pack_instrumentation_scope(writer, scope_span->instrumentation_scope);
}
else {
mpack_write_nil(writer);
}

/* spans */
mpack_write_cstr(writer, "spans");
Expand Down

0 comments on commit cdc0e31

Please sign in to comment.