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>1 parent 308c195 commit 8170260File tree Expand file treeCollapse file tree 1 file changedCopy full SHA for 8170260
+3
-1
lines changedFilter options
+3
-1
lines changed +3-1Lines changed: 3 additions & 1 deletion Original file line number Diff line number Diff line change
@@ -5696,7 +5696,9 @@ static void str_to_reg(yankreg_T *y_ptr, MotionType yank_type, const char_u *str
5696
5696
// When appending, copy the previous line and free it after.
5697
5697
size_t extra = append ? STRLEN(pp[--lnum]) : 0;
5698
5698
char_u *s = xmallocz(line_len + extra);
5699
-
memcpy(s, pp[lnum], extra);
5699
+
if (extra > 0) {
5700
+
memcpy(s, pp[lnum], extra);
5701
+
}
5700
5702
memcpy(s + extra, start, line_len);
5701
5703
size_t s_len = extra + line_len;
5702
5704
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4