forked from aniani/vim
patch 9.1.1041: Vim9: out-of-bound access when echoing an enum
Problem: Vim9: out-of-bound access when echoing an enum
Solution: Add NUL to growarray, check that ufunc is non-null
before accessing it to make Coverity happy
(Yegappan Lakshmanan)
closes: #16488
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
d79ea47079
commit
cb848b687f
@@ -1586,4 +1586,19 @@ def Test_lambda_block_in_enum()
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
" Echo an enum
|
||||
def Test_enum_echo()
|
||||
var lines =<< trim END
|
||||
vim9script
|
||||
enum Demo
|
||||
one('tahi'),
|
||||
two('rua'),
|
||||
three('toru')
|
||||
var alias: string
|
||||
endenum
|
||||
assert_equal('enum Demo.one {name: one, ordinal: 0, alias: tahi}', execute('echo Demo.one')->split("\n")[0])
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
|
||||
|
||||
Reference in New Issue
Block a user