forked from aniani/vim
patch 9.0.0220: invalid memory access with for loop over NULL string
Problem: Invalid memory access with for loop over NULL string. Solution: Make sure mb_ptr2len() consistently returns zero for NUL.
This commit is contained in:
@@ -75,6 +75,18 @@ func Test_for_invalid()
|
||||
redraw
|
||||
endfunc
|
||||
|
||||
func Test_for_over_null_string()
|
||||
let save_enc = &enc
|
||||
set enc=iso8859
|
||||
let cnt = 0
|
||||
for c in test_null_string()
|
||||
let cnt += 1
|
||||
endfor
|
||||
call assert_equal(0, cnt)
|
||||
|
||||
let &enc = save_enc
|
||||
endfunc
|
||||
|
||||
func Test_readfile_binary()
|
||||
new
|
||||
call setline(1, ['one', 'two', 'three'])
|
||||
|
||||
Reference in New Issue
Block a user