Fix pasting crash in edit box (fixes #4230)

Don't allocate string with -1 size
This commit is contained in:
def 2021-10-19 13:49:31 +02:00
parent f0ef018d1e
commit 663eea9cab

View file

@ -51,7 +51,7 @@ int CUIEx::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSi
const char *pText = Input()->GetClipboardText();
if(pText)
{
int OffsetL = minimum(str_length(pStr), m_CurCursor);
int OffsetL = clamp(m_CurCursor, 0, str_length(pStr));
int OffsetR = OffsetL;
if(m_HasSelection)