mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
fix(ops): str_to_reg passing NULL to memcpy
Required for the tests introduced in v8.2.3601 to pass ASAN when running test_alot.vim. Co-authored-by: erw7 <erw7.github@gmail.com>
This commit is contained in:
@@ -5696,7 +5696,9 @@ static void str_to_reg(yankreg_T *y_ptr, MotionType yank_type, const char_u *str
|
||||
// When appending, copy the previous line and free it after.
|
||||
size_t extra = append ? STRLEN(pp[--lnum]) : 0;
|
||||
char_u *s = xmallocz(line_len + extra);
|
||||
if (extra > 0) {
|
||||
memcpy(s, pp[lnum], extra);
|
||||
}
|
||||
memcpy(s + extra, start, line_len);
|
||||
size_t s_len = extra + line_len;
|
||||
|
||||
|
Reference in New Issue
Block a user