1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-11 00:04:24 +00:00

InputTextWithHint(): Fixed buffer overflow when user callback modifies the buffer contents in a way that alters hint visibility. (#8368)

This commit is contained in:
ocornut 2025-02-03 15:11:03 +01:00
parent 204cebc8fc
commit 5dd84082ab
4 changed files with 18 additions and 1 deletions

View file

@ -2012,6 +2012,7 @@ const char* ImStreolRange(const char* str, const char* str_end)
const char* ImStrbol(const char* buf_mid_line, const char* buf_begin) // find beginning-of-line
{
IM_ASSERT_PARANOID(buf_mid_line >= buf_begin && buf_mid_line <= buf_begin + strlen(buf_begin));
while (buf_mid_line > buf_begin && buf_mid_line[-1] != '\n')
buf_mid_line--;
return buf_mid_line;