mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-26 02:34:23 +00:00
Fixed unlikely buffer overrun in InputCharacters (thanks Daniel Collin)
This commit is contained in:
parent
48a944813c
commit
9f05a2bb16
2 changed files with 2 additions and 2 deletions
|
|
@ -348,7 +348,7 @@ static size_t ImStrlenW(const ImWchar* str);
|
|||
void ImGuiIO::AddInputCharacter(ImWchar c)
|
||||
{
|
||||
const size_t n = ImStrlenW(InputCharacters);
|
||||
if (n < sizeof(InputCharacters) / sizeof(InputCharacters[0]))
|
||||
if (n + 1 < sizeof(InputCharacters) / sizeof(InputCharacters[0]))
|
||||
{
|
||||
InputCharacters[n] = c;
|
||||
InputCharacters[n+1] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue