patch 8.2.4974: ":so" command may read after end of buffer
Problem: ":so" command may read after end of buffer.
Solution: Compute length of text properly.
diff --git a/src/testdir/test_source.vim b/src/testdir/test_source.vim
index 5f45ab4..4736e93 100644
--- a/src/testdir/test_source.vim
+++ b/src/testdir/test_source.vim
@@ -652,6 +652,17 @@
norm300gr0
so
bwipe!
+
+ let lines =<< trim END
+ new
+ norm 10a0000000000ø00000000000
+ norm i0000000000000000000
+ silent! so
+ END
+ call writefile(lines, 'Xtest.vim')
+ source Xtest.vim
+ bwipe!
+ call delete('Xtest.vim')
endfunc