chore(nvim_paste): assert the correct String (#17752)

This commit is contained in:
zeertzjq
2022-03-24 19:40:00 +08:00
committed by GitHub
parent 534f5a419d
commit 4a11c7e56f

View File

@@ -1328,7 +1328,7 @@ Boolean nvim_paste(String data, Boolean crlf, Integer phase, Error *err)
if (!cancel && !(State & CMDLINE)) { // Dot-repeat.
for (size_t i = 0; i < lines.size; i++) {
String s = lines.items[i].data.string;
assert(data.size <= INT_MAX);
assert(s.size <= INT_MAX);
AppendToRedobuffLit((char_u *)s.data, (int)s.size);
// readfile()-style: "\n" is indicated by presence of N+1 item.
if (i + 1 < lines.size) {