Open
Description
Users of the EASTL might compare a string object to nullptr. While this is actually a useless operation, given string objects cannot be NULL, it may occurr in templated code and ripple down to the point where CharStrlen
from char_traits.h
is called with a nullptr, triggering a segfault.
A real life example for this is when EASTL is used with the trompeloeil
mocking framework.
Minimal demo:
#include <EASTL/fixed_string.h>
int main() {
constexpr size_t minSize{2U};
eastl::fixed_string<char, minSize, false> fs;
if (fs == nullptr)
{
// This is useless as it can never occur. But it will segfault.
}
}
Imho, there shall be a check for null in the operator==
implementation(s).
Metadata
Metadata
Assignees
Labels
No labels