diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2016-08-24 22:49:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-24 22:49:20 +0200 |
commit | 2b7f32633c07de9fc4b8751ac73cf3049976b007 (patch) | |
tree | 65dd2a0ff14ee6533354c8cc62aad55577cba786 /src | |
parent | 17f4bd20601eb5af59567b68c69c396e65274327 (diff) | |
parent | 251d8a686a2717c4b1ab9dfc3599eab75105c076 (diff) | |
download | irssi-2b7f32633c07de9fc4b8751ac73cf3049976b007.zip |
Merge pull request #532 from LemonBoy/x1x2
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; |