0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.0.1657: crash when reading a channel

Problem:    Crash when reading a channel.
Solution:   Clear the write flag before writing. (idea by Shinya Ohyanagi,
            closes #2769).
This commit is contained in:
Bram Moolenaar 2018-04-03 12:51:01 +02:00
parent 8b31a6ff7a
commit 9af9778209
2 changed files with 4 additions and 1 deletions

View File

@ -4150,8 +4150,9 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in)
if (ret > 0 && in_part->ch_fd != INVALID_FD
&& FD_ISSET(in_part->ch_fd, wfds))
{
channel_write_input(channel);
/* Clear the flag first, ch_fd may change in channel_write_input(). */
FD_CLR(in_part->ch_fd, wfds);
channel_write_input(channel);
--ret;
}
}

View File

@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1657,
/**/
1656,
/**/