1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Fix an OOB access in the cutbuffer implementation.

This commit is contained in:
LemonBoy 2016-08-24 22:29:52 +02:00
parent 17f4bd2060
commit 251d8a686a

View File

@ -655,7 +655,7 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, CUTBUFFER_UPDATE_OP update_
tmp->cutbuffer = g_new(unichar, cutbuffer_new_size+1);
memcpy(tmp->cutbuffer, tmpcutbuffer,
tmp->cutbuffer_len * sizeof(unichar));
memcpy(tmp->cutbuffer + tmp->cutbuffer_len * sizeof(unichar),
memcpy(tmp->cutbuffer + tmp->cutbuffer_len,
entry->text + entry->pos - size, size * sizeof(unichar));
tmp->cutbuffer_len = cutbuffer_new_size;