Mercurial > vim
comparison src/channel.c @ 13569:97720d9a01d4 v8.0.1657
patch 8.0.1657: crash when reading a channel
commit https://github.com/vim/vim/commit/9af9778209cd0cbb284f6ff7e88f707418089975
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 3 12:51:01 2018 +0200
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).
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 03 Apr 2018 13:00:07 +0200 |
parents | 6faef782f50b |
children | 8723e4496dd1 |
comparison
equal
deleted
inserted
replaced
13568:5ec18e517884 | 13569:97720d9a01d4 |
---|---|
4148 | 4148 |
4149 in_part = &channel->ch_part[PART_IN]; | 4149 in_part = &channel->ch_part[PART_IN]; |
4150 if (ret > 0 && in_part->ch_fd != INVALID_FD | 4150 if (ret > 0 && in_part->ch_fd != INVALID_FD |
4151 && FD_ISSET(in_part->ch_fd, wfds)) | 4151 && FD_ISSET(in_part->ch_fd, wfds)) |
4152 { | 4152 { |
4153 /* Clear the flag first, ch_fd may change in channel_write_input(). */ | |
4154 FD_CLR(in_part->ch_fd, wfds); | |
4153 channel_write_input(channel); | 4155 channel_write_input(channel); |
4154 FD_CLR(in_part->ch_fd, wfds); | |
4155 --ret; | 4156 --ret; |
4156 } | 4157 } |
4157 } | 4158 } |
4158 | 4159 |
4159 return ret; | 4160 return ret; |