mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
patch 9.2.0282: tests: Test_viminfo_len_overflow() fails
Problem: tests: Test_viminfo_len_overflow() fails Solution: Catch E342 (Yasuhiro Matsumoto). Test_viminfo_len_overflow tries to allocate ~4GB, which may throw E342 (out of memory) depending on the platform's memory allocation behavior. This is an acceptable outcome since the test's purpose is to verify that Vim does not crash on a crafted viminfo entry. closes: #19891 Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
c91081d0e5
commit
b2ff915fe4
@@ -1385,8 +1385,13 @@ func Test_viminfo_len_overflow()
|
||||
\ '|<CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC',
|
||||
\ '|<DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD'], viminfo_file, 'b')
|
||||
|
||||
" Should not crash or cause memory errors
|
||||
exe 'rviminfo! ' .. viminfo_file
|
||||
" Should not crash or cause memory errors.
|
||||
" E342 (out of memory) may be thrown depending on the platform's memory
|
||||
" allocation behavior, which is an acceptable outcome.
|
||||
try
|
||||
exe 'rviminfo! ' .. viminfo_file
|
||||
catch /E342/
|
||||
endtry
|
||||
|
||||
let &viminfofile = _viminfofile
|
||||
endfunc
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
282,
|
||||
/**/
|
||||
281,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user