diff options
author | LemonBoy <thatlemon@gmail.com> | 2016-08-24 22:29:52 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2016-08-24 22:29:52 +0200 |
commit | 251d8a686a2717c4b1ab9dfc3599eab75105c076 (patch) | |
tree | 65dd2a0ff14ee6533354c8cc62aad55577cba786 /src | |
parent | 17f4bd20601eb5af59567b68c69c396e65274327 (diff) | |
download | irssi-251d8a686a2717c4b1ab9dfc3599eab75105c076.zip |
Fix an OOB access in the cutbuffer implementation.
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-text/gui-entry.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 82645a8e..f05decd2 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -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; |