diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-04-03 12:51:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-04-03 12:51:01 +0200 |
commit | 9af9778209cd0cbb284f6ff7e88f707418089975 (patch) | |
tree | 918565320329b05e75862ffa7a31ef5cc9abc48c /src/channel.c | |
parent | 8b31a6ff7a0a8184ddc9997a0cc4aa5f2350b279 (diff) | |
download | vim-git-9af9778209cd0cbb284f6ff7e88f707418089975.tar.gz |
patch 8.0.1657: crash when reading a channelv8.0.1657
Problem: Crash when reading a channel.
Solution: Clear the write flag before writing. (idea by Shinya Ohyanagi,
closes #2769).
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c index 3b71472fd..38e639224 100644 --- a/src/channel.c +++ b/src/channel.c @@ -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; } } |