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
An empty std::string_view returns nullptr from its data() and 0 from its size().
One might expect that by calling Insert(p, view.data(), view.size()) should work, but when view is empty, this actually leads into dereferencing a null pointer because of strlen(new_text).
Could Dear ImGui support null char* in its API?
The text was updated successfully, but these errors were encountered:
Hello,
Thanks for reporting. This is analogous to #3615 we did for TextUnformatted().
I have pushed a fix 6417268.
Proposed fix #6566 would erroneously silently not-crash on (NULL,non-NULL) combo so I am opting for a == test there.
Thank you!
imgui/imgui_widgets.cpp
Lines 3874 to 3877 in 655aae5
An empty
std::string_view
returnsnullptr
from itsdata()
and0
from itssize()
.One might expect that by calling
Insert(p, view.data(), view.size())
should work, but whenview
is empty, this actually leads into dereferencing a null pointer because ofstrlen(new_text)
.Could Dear ImGui support null
char*
in its API?The text was updated successfully, but these errors were encountered: