Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch 8.0.0493: crash with cd command with very long argument
Problem: Crash with cd command with very long argument. Solution: Check for running out of space. (Dominique pending, closes #1576)
- Loading branch information
Showing
5 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
" Test for :cd | ||
|
||
func Test_cd_large_path() | ||
" This used to crash with a heap write overflow. | ||
call assert_fails('cd ' . repeat('x', 5000), 'E472:') | ||
endfunc | ||
|
||
func Test_cd_up_and_down() | ||
let path = getcwd() | ||
cd .. | ||
exe 'cd ' . path | ||
call assert_equal(path, getcwd()) | ||
endfunc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters