-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InputTextMultiline copy paste buffer overflow bug #4038
Comments
Thanks for the repro, @LPVOIDDev! I can reproduce this now. It looks like that loop is expecting Line 1134 in d6a5cc7
But it isn't doing that because This external issue appears to be the root cause: nothings/stb#734 I agree with Unit2Ed here. Unless I'm missing something, removing the undo point seems unnecessary because it was never even created. I removed the decrement like they mentioned and the problem goes away for me. It seems to me like a failed insert has the potential to corrupt I'd need more time to investigate for sure though, I didn't dig into things very much. |
If state->undo_char_point is an unsigned integer then the value is set to 255 , which eventulally will lead to a loop. |
…cases could corrupt the undo stack. (#4038)
Fixed by d9b6066 and submitting PR to nothings/stb |
Version/Branch of Dear ImGui:
Version: Dear ImGui 1.83 WIP (18203)
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_win32.cpp + imgui_impl_dx10.cpp
Compiler: Visual Studio 2015 (v140)
Operating System: Windows 10 (1809)
My Issue/Question:
The whole program hangs when copy-pasting a text in a InputTextMultiline with buffer size 1024
Steps to reproduce:
static char text[1024 * 16] =
tostatic char text[1024 * 1] =
Demo > Widgets > Text Input > Multi-line Text Input
Some insight:
Unfortunately, I was not able to debug the issue directly from VS2015 because the debugger doesn't work on this version of VS.
But I've gone through manually debugging with CE
I found out that it never goes out of this loop because
state->undo_char_point + numchars
is always1050
whereasSTB_TEXTEDIT_UNDOCHARCOUNT
is set to999
ECX value never changes and is stuck with value 1050 (0x41a)
The text was updated successfully, but these errors were encountered: