You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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
fromchar_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:
Imho, there shall be a check for null in the
operator==
implementation(s).The text was updated successfully, but these errors were encountered: