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 authored and edsiper committed Aug 5, 2024
1 parent 3603c1a commit 20164bd
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 @@ -424,7 +424,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 20164bd

Please sign in to comment.