diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-22 15:02:19 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-22 18:43:01 +0100 |
commit | c398402f1225e8050856260cbc6ae929ff2f5c31 (patch) | |
tree | 1970d355f0d58dfbedd653c267070c28ee0c5bef /src/nvim/window.c | |
parent | 830b31683e9958130a64b9dec990f42b58efc0a7 (diff) | |
download | rneovim-c398402f1225e8050856260cbc6ae929ff2f5c31.tar.gz rneovim-c398402f1225e8050856260cbc6ae929ff2f5c31.tar.bz2 rneovim-c398402f1225e8050856260cbc6ae929ff2f5c31.zip |
vim-patch:8.0.0307
Problem: Asan detects a memory error when EXITFREE is defined. (Dominique
Pelle)
Solution: In getvcol() check for ml_get_buf() returning an empty string.
Also skip adjusting the scroll position. Set "exiting" in
mch_exit() for all systems.
https://github.com/vim/vim/commit/955f198fc546cc30a34361932d3f454a61df0efa
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index db6c0f9048..dc0ce03794 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4803,7 +4803,11 @@ void win_new_height(win_T *wp, int height) wp->w_height = height; wp->w_skipcol = 0; - scroll_to_fraction(wp, prev_height); + // There is no point in adjusting the scroll position when exiting. Some + // values might be invalid. + if (!exiting) { + scroll_to_fraction(wp, prev_height); + } } void scroll_to_fraction(win_T *wp, int prev_height) |