Repository navigation
Fix SegFault of using the logger to print the stream_id (which is char[16]) as a string. - #117
Conversation
Xenofon Foukas (xfoukas)
left a comment
There was a problem hiding this comment.
The description of the PR is somehow misleading. The stream id is not a string, so it shouldn't be used for logging, unless it is first converted to string (which is what this PR does). Please update the description to explain that this is a bugfix in the way that the logger was used to print a non-string.
Fixed. |
Pull request was closed
| io_channel, | ||
| io_channel->stream_id.id); | ||
| char sname[JBPF_IO_STREAM_ID_LEN * 3]; | ||
| _jbpf_io_tohex_str(io_channel->stream_id.id, JBPF_IO_STREAM_ID_LEN, sname, JBPF_IO_STREAM_ID_LEN * 3); |
There was a problem hiding this comment.
will this add a NULL terminator ?
Addressed the comment by modifying the PR description - dismissed it to get in quicker.
This PR fixes the bug that causes a segfault by using the logger to print the stream_id (which is char[16]) as a string. Therefore, this PR converts the stream_id to string first before using the jbpf_logger to print it as string type e.g. %s.
Tested in pipeline:
