vim-patch:8.0.0331

Problem:    Restoring help snapshot accesses freed memory. (Dominique Pelle)
Solution:   Don't restore a snapshot when the window closes.

343b8c0429
This commit is contained in:
Justin M. Keyes 2017-03-22 02:20:06 +01:00
parent 54f31187ba
commit 41bffeacff
2 changed files with 18 additions and 4 deletions

View File

@ -0,0 +1,16 @@
" Tests for :help
func Test_help_restore_snapshot()
help
set buftype=
help
edit x
help
helpclose
endfunc
func Test_help_errors()
call assert_fails('help doesnotexist', 'E149:')
call assert_fails('help!', 'E478:')
endfunc

View File

@ -5365,10 +5365,8 @@ restore_snapshot (
clear_snapshot(curtab, idx);
}
/*
* Check if frames "sn" and "fr" have the same layout, same following frames
* and same children.
*/
/// Check if frames "sn" and "fr" have the same layout, same following frames
/// and same children. And the window pointer is valid.
static int check_snapshot_rec(frame_T *sn, frame_T *fr)
{
if (sn->fr_layout != fr->fr_layout