diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-08-25 01:34:19 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-08-25 01:34:19 +0000 |
commit | 6ab43fdc31e25b114eec1f3ee25264b5f6a1a0f3 (patch) | |
tree | e4fdaa56f638079ebf75c6c145b18ce5c1b93ba0 /vl.c | |
parent | 70f23b776a22e341443e8ae015627a4e041d662b (diff) |
Avoid SEGV in IOHandler dispatch, by Daniel P. Berrange.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3132 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -6823,12 +6823,10 @@ void main_loop_wait(int timeout) IOHandlerRecord **pioh; for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) { - if (ioh->deleted) - continue; - if (FD_ISSET(ioh->fd, &rfds)) { + if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) { ioh->fd_read(ioh->opaque); } - if (FD_ISSET(ioh->fd, &wfds)) { + if (!ioh->deleted && ioh->fd_write && FD_ISSET(ioh->fd, &wfds)) { ioh->fd_write(ioh->opaque); } } |