From 251d8a686a2717c4b1ab9dfc3599eab75105c076 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Wed, 24 Aug 2016 22:29:52 +0200 Subject: Fix an OOB access in the cutbuffer implementation. --- src/fe-text/gui-entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3