mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
InputTextMultiline with ReadOnly flag: AddressSanitizer crash #6570
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#6570
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui: any of 1.89.6/master/docking
Back-end/Renderer/Compiler/OS:
Backend: tested on examples sdl2 + sdlrenderer2/opengl3
Compiler: g++ 11.3.0
Operating System: Ubuntu 22.04
My Issue:
Address sanitizer catches global-buffer-overflow inside
InputTextMultilinewith ReadOnly flag.Happens when the text box loses focus (when I click in and out).
Standalone, minimal, complete and verifiable example:
Modify any example, add window:
Buffer can also be
std::string, and static or not static. Error does not happen when content is empty string.Issue seems to be in
InputTextDeactivateHook(ImGuiID id). With ReadOnly flag thestate->TextA.Datais null, butstate->CurLenAis length of content string. The memcpy runs on constant string literal""with inappropriate length.Thank you for reporting! This is a followup to #6292 #4714 (commits
e8206db82,5a2b1e848). Investigating now.Turns out my fix
e8206dbwas incorrect. That data is not used on ReadOnly fields. Pushed fixd4ddc46Incidentally I was just about to tag 1.89.7 so this will go into it. Thanks!