mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
vim-patch:8.2.5016: access before start of text with a put command (#18742)
Problem: Access before start of text with a put command.
Solution: Check the length is more than zero.
2a585c8501
This commit is contained in:
@@ -3696,8 +3696,11 @@ error:
|
||||
len = STRLEN(y_array[y_size - 1]);
|
||||
col = (colnr_T)len - lendiff;
|
||||
if (col > 1) {
|
||||
curbuf->b_op_end.col = col - 1 - utf_head_off(y_array[y_size - 1],
|
||||
y_array[y_size - 1] + len - 1);
|
||||
curbuf->b_op_end.col = col - 1;
|
||||
if (len > 0) {
|
||||
curbuf->b_op_end.col -= utf_head_off(y_array[y_size - 1],
|
||||
y_array[y_size - 1] + len - 1);
|
||||
}
|
||||
} else {
|
||||
curbuf->b_op_end.col = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user