Closed akoepsel closed 3 years ago
I have changed the branch to next, to prepare for the merges.
@KanjiMonster could you please add your comment from #306 here as well?
I don't think not logging is the right solution.
Maybe we can have a helper function something like
std::string_view safe_string_view(const char *str)
{
if (str == nullptr)
return std::string_view("(null)");
else
return std::string_view(str);
}
and then use this everywhere where we might have a null pointer? This would replicate printf
's behavior when passing NULL to a %s.
Finally, let's maybe have only one PR for this.
is this still being worked on?
Description
In cnetlink.cc line 1075 the VLOG call must not call std::string_view(NULL). Added two checks to prevent a situation where calling rtnl_link_get_type() or rtnl_link_get_slave_type() yield a NULL pointer, inevitably causing an exception.
Motivation and Context
How Has This Been Tested?