Mercurial > vim
comparison src/testdir/test_fold.vim @ 33488:0081ca43bee9 v9.0.1995
patch 9.0.1995: Invalid memory access with empty 'foldexpr'
Commit: https://github.com/vim/vim/commit/a991ce9c083bb8c02b1b1ec34ed35728197050f3
Author: zeertzjq <zeertzjq@outlook.com>
Date: Fri Oct 6 19:16:36 2023 +0200
patch 9.0.1995: Invalid memory access with empty 'foldexpr'
Problem: Invalid memory access when 'foldexpr' returns empty string.
Solution: Check for NUL.
closes: #13293
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 06 Oct 2023 19:30:07 +0200 |
parents | cceee401aa51 |
children | 48955338edb1 |
comparison
equal
deleted
inserted
replaced
33487:0864a58c7a4a | 33488:0081ca43bee9 |
---|---|
1768 call assert_equal(screenattr(1, 5), screenattr(2, 2)) | 1768 call assert_equal(screenattr(1, 5), screenattr(2, 2)) |
1769 | 1769 |
1770 bwipe! | 1770 bwipe! |
1771 endfunc | 1771 endfunc |
1772 | 1772 |
1773 " This used to cause invalid memory access | |
1774 func Test_foldexpr_return_empty_string() | |
1775 new | |
1776 setlocal foldexpr='' foldmethod=expr | |
1777 redraw | |
1778 | |
1779 bwipe! | |
1780 endfunc | |
1781 | |
1773 " vim: shiftwidth=2 sts=2 expandtab | 1782 " vim: shiftwidth=2 sts=2 expandtab |