fix coredump when use vnew command
This commit is contained in:
parent
a90f26f536
commit
efd8398122
@ -0,0 +1,58 @@
|
|||||||
|
From 59149f02692804267e7cc0665d0334f6ff4675be Mon Sep 17 00:00:00 2001
|
||||||
|
From: zeertzjq <zeertzjq@outlook.com>
|
||||||
|
Date: Sat, 14 Sep 2024 10:40:29 +0200
|
||||||
|
Subject: [PATCH] patch 9.1.0730: Crash with cursor-screenline and narrow
|
||||||
|
window
|
||||||
|
|
||||||
|
Problem: Crash with cursor-screenline and narrow window
|
||||||
|
(elig0n)
|
||||||
|
Solution: Don't set right_col when width2 is 0 (zeertzjq).
|
||||||
|
|
||||||
|
fixes: #15677
|
||||||
|
closes: #15678
|
||||||
|
|
||||||
|
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
|
||||||
|
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
||||||
|
---
|
||||||
|
src/drawline.c | 2 +-
|
||||||
|
src/testdir/test_cursorline.vim | 11 +++++++++++
|
||||||
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/drawline.c b/src/drawline.c
|
||||||
|
index b627192a4ee0f..fd5d56b43e508 100644
|
||||||
|
--- a/src/drawline.c
|
||||||
|
+++ b/src/drawline.c
|
||||||
|
@@ -61,7 +61,7 @@ margin_columns_win(win_T *wp, int *left_col, int *right_col)
|
||||||
|
*left_col = 0;
|
||||||
|
*right_col = width1;
|
||||||
|
|
||||||
|
- if (wp->w_virtcol >= (colnr_T)width1)
|
||||||
|
+ if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0)
|
||||||
|
*right_col = width1 + ((wp->w_virtcol - width1) / width2 + 1) * width2;
|
||||||
|
if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0)
|
||||||
|
*left_col = (wp->w_virtcol - width1) / width2 * width2 + width1;
|
||||||
|
diff --git a/src/testdir/test_cursorline.vim b/src/testdir/test_cursorline.vim
|
||||||
|
index bdde670d207a5..d258111ae4de1 100644
|
||||||
|
--- a/src/testdir/test_cursorline.vim
|
||||||
|
+++ b/src/testdir/test_cursorline.vim
|
||||||
|
@@ -293,6 +293,17 @@ func Test_cursorline_screenline_update()
|
||||||
|
call delete('Xcul_screenline')
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
+func Test_cursorline_screenline_zero_width()
|
||||||
|
+ CheckOption foldcolumn
|
||||||
|
+
|
||||||
|
+ set cursorline culopt=screenline winminwidth=1 foldcolumn=1
|
||||||
|
+ " This used to crash Vim
|
||||||
|
+ 1vnew | redraw
|
||||||
|
+
|
||||||
|
+ bwipe!
|
||||||
|
+ set cursorline& culopt& winminwidth& foldcolumn&
|
||||||
|
+endfunc
|
||||||
|
+
|
||||||
|
func Test_cursorline_cursorbind_horizontal_scroll()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
9
vim.spec
9
vim.spec
@ -12,7 +12,7 @@
|
|||||||
Name: vim
|
Name: vim
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Version: 9.0
|
Version: 9.0
|
||||||
Release: 28
|
Release: 29
|
||||||
Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text.
|
Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text.
|
||||||
License: Vim and MIT
|
License: Vim and MIT
|
||||||
URL: http://www.vim.org
|
URL: http://www.vim.org
|
||||||
@ -126,6 +126,7 @@ Patch6096: backport-patch-9.1.0554-bw-leaves-jumplist-and-tagstack-data-.pa
|
|||||||
Patch6097: backport-CVE-2024-41957.patch
|
Patch6097: backport-CVE-2024-41957.patch
|
||||||
Patch6098: backport-CVE-2024-43374.patch
|
Patch6098: backport-CVE-2024-43374.patch
|
||||||
Patch6099: backport-CVE-2024-43802.patch
|
Patch6099: backport-CVE-2024-43802.patch
|
||||||
|
Patch6100: backport-patch-9.1.0730-crash-with-cursor-screenline-and-narrow-window.patch
|
||||||
|
|
||||||
Patch9000: bugfix-rm-modify-info-version.patch
|
Patch9000: bugfix-rm-modify-info-version.patch
|
||||||
Patch9001: vim-Add-sw64-architecture.patch
|
Patch9001: vim-Add-sw64-architecture.patch
|
||||||
@ -537,6 +538,12 @@ LANG=en_US.UTF-8 make -j1 test
|
|||||||
%{_mandir}/man1/evim.*
|
%{_mandir}/man1/evim.*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 12 2024 wangjiang <app@cameyan.com> - 2:9.0-29
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix coredump when use vnew command
|
||||||
|
|
||||||
* Tue Oct 08 2024 changtao <changtao@kylinos.cn> - 2:9.0-28
|
* Tue Oct 08 2024 changtao <changtao@kylinos.cn> - 2:9.0-28
|
||||||
- Type:CVE
|
- Type:CVE
|
||||||
- ID:CVE-2024-47814
|
- ID:CVE-2024-47814
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user