mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.1.0069: ScreenLines may not be correctly initialized, causing hang
Problem: ScreenLines may not be correctly initialized, causing hang (Olaf Seibert, after 9.0.0220) Solution: always initialize ScreneLines when allocating a screen (Olaf Seibert) ScreenLines and related structures could be left uninitialized causing a screen update to run into an infinite loop when using latin1 encoding. Partly caused because by patch 9.0.0220, which makes mb_ptr2len return zero for NUL related: #12671 closes: #13946 Signed-off-by: Olaf Seibert <rhialto@falu.nl> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
59bafc8171
commit
fd472655a9
17
src/screen.c
17
src/screen.c
@ -2569,14 +2569,6 @@ give_up:
|
|||||||
new_LineOffset[new_row] = new_row * Columns;
|
new_LineOffset[new_row] = new_row * Columns;
|
||||||
new_LineWraps[new_row] = FALSE;
|
new_LineWraps[new_row] = FALSE;
|
||||||
|
|
||||||
/*
|
|
||||||
* If the screen is not going to be cleared, copy as much as
|
|
||||||
* possible from the old screen to the new one and clear the rest
|
|
||||||
* (used when resizing the window at the "--more--" prompt or when
|
|
||||||
* executing an external command, for the GUI).
|
|
||||||
*/
|
|
||||||
if (!doclear)
|
|
||||||
{
|
|
||||||
(void)vim_memset(new_ScreenLines + new_row * Columns,
|
(void)vim_memset(new_ScreenLines + new_row * Columns,
|
||||||
' ', (size_t)Columns * sizeof(schar_T));
|
' ', (size_t)Columns * sizeof(schar_T));
|
||||||
if (enc_utf8)
|
if (enc_utf8)
|
||||||
@ -2595,6 +2587,15 @@ give_up:
|
|||||||
0, (size_t)Columns * sizeof(sattr_T));
|
0, (size_t)Columns * sizeof(sattr_T));
|
||||||
(void)vim_memset(new_ScreenCols + new_row * Columns,
|
(void)vim_memset(new_ScreenCols + new_row * Columns,
|
||||||
0, (size_t)Columns * sizeof(colnr_T));
|
0, (size_t)Columns * sizeof(colnr_T));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the screen is not going to be cleared, copy as much as
|
||||||
|
* possible from the old screen to the new one and clear the rest
|
||||||
|
* (used when resizing the window at the "--more--" prompt or when
|
||||||
|
* executing an external command, for the GUI).
|
||||||
|
*/
|
||||||
|
if (!doclear)
|
||||||
|
{
|
||||||
old_row = new_row + (screen_Rows - Rows);
|
old_row = new_row + (screen_Rows - Rows);
|
||||||
if (old_row >= 0 && ScreenLines != NULL)
|
if (old_row >= 0 && ScreenLines != NULL)
|
||||||
{
|
{
|
||||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
69,
|
||||||
/**/
|
/**/
|
||||||
68,
|
68,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user