mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.4218: illegal memory access with bracketed paste in Ex mode
Problem: Illegal memory access with bracketed paste in Ex mode. Solution: Reserve space for the trailing NUL.
This commit is contained in:
@@ -4452,7 +4452,8 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
||||
break;
|
||||
|
||||
case PASTE_EX:
|
||||
if (gap != NULL && ga_grow(gap, idx) == OK)
|
||||
// add one for the NUL that is going to be appended
|
||||
if (gap != NULL && ga_grow(gap, idx + 1) == OK)
|
||||
{
|
||||
mch_memmove((char *)gap->ga_data + gap->ga_len,
|
||||
buf, (size_t)idx);
|
||||
|
Reference in New Issue
Block a user