diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-12-19 19:19:31 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-19 19:19:31 +0000 |
commit | bc404bfb32cf2bef34050d2aeae0ea72ccf980cc (patch) | |
tree | 31d8afcbb43b5cde41311e847caddcc199d42178 /src/testdir/test_blob.vim | |
parent | 86b3ab4fa0de3e8884ab6a6ced2a70592b937d0f (diff) |
patch 8.2.3855: illegal memory access when displaying a blobv8.2.3855
Problem: Illegal memory access when displaying a blob.
Solution: Append a NUL at the end. (Yegappan Lakshmanan, closes #9372)
Diffstat (limited to 'src/testdir/test_blob.vim')
-rw-r--r-- | src/testdir/test_blob.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testdir/test_blob.vim b/src/testdir/test_blob.vim index bd816af4a5..3ce95756f1 100644 --- a/src/testdir/test_blob.vim +++ b/src/testdir/test_blob.vim @@ -680,5 +680,12 @@ func Test_list2blob() call assert_equal(0z00010203, list2blob(range(4))) endfunc +" The following used to cause an out-of-bounds memory access +func Test_blob2string() + let v = '0z' .. repeat('01010101.', 444) + let v ..= '01' + exe 'let b = ' .. v + call assert_equal(v, string(b)) +endfunc " vim: shiftwidth=2 sts=2 expandtab |