0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.3855: illegal memory access when displaying a blob

Problem:    Illegal memory access when displaying a blob.
Solution:   Append a NUL at the end. (Yegappan Lakshmanan, closes #9372)
This commit is contained in:
Yegappan Lakshmanan
2021-12-19 19:19:31 +00:00
committed by Bram Moolenaar
parent 86b3ab4fa0
commit bc404bfb32
5 changed files with 14 additions and 4 deletions

View File

@@ -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