-
Notifications
You must be signed in to change notification settings - Fork 501
Closed
Labels
bugSomething isn't workingSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
The opentracing shim does a few conversions in either direction between the implementation of opentracing::string_view
to nostd::string_view
, by constructing the target with just the .data()
part.
The approach might be OK as is, in general, but is highly speculative on the source buffer being null terminated. The alternative is explicitly constructing the target string view with the size of the buffer.
For instance, the proper mapping in shim_utils.h L32 would look like this:
- AttributeValue operator()(opentracing::string_view v) { return nostd::string_view{v.data()}; }
+ AttributeValue operator()(opentracing::string_view v)
+ {
+ return nostd::string_view{v.data(), v.size()};
+ }
This would make it for the correct use of string view at the expense of a bit more verbosity.
marcalff
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.