Fix #27359: Pasting long text crashes blender
Actual problem was caused by insufficient buffer size in ui_text_leftclip() Also fixed possible invalid memory write in GHOST_SystemWin32::getClipboard which was caused by accessing clipboard buffer after closing clipboard. This mustn't happen. Also fixed possible crush when buffer was failed to be locked.
This commit is contained in:
@@ -888,7 +888,7 @@ static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
|
||||
/* textbut exception, clip right when... */
|
||||
if(but->editstr && but->pos >= 0) {
|
||||
float width;
|
||||
char buf[256];
|
||||
char buf[UI_MAX_DRAW_STR];
|
||||
|
||||
/* copy draw string */
|
||||
BLI_strncpy(buf, but->drawstr, sizeof(buf));
|
||||
|
||||
Reference in New Issue
Block a user