patch 9.2.0282: tests: Test_viminfo_len_overflow() fails
Commit:
https://github.com/vim/vim/commit/b2ff915fe48d66a3d252b87f77e1635aa01cca51
Author: Yasuhiro Matsumoto <[email protected]>
Date: Thu Apr 2 16:30:05 2026 +0000
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/testdir/test_viminfo.vim b/src/testdir/test_viminfo.vim
index b3a8b91cb..de987ef27 100644
--- a/src/testdir/test_viminfo.vim
+++ b/src/testdir/test_viminfo.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index d0b469248..a05e5f39b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 282,
/**/
281,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1w8LAF-000m9L-Hm%40256bit.org.