mirror of
https://github.com/qemu/qemu.git
synced 2025-08-15 13:47:03 +00:00
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
This commit is contained in:
parent
70f23b776a
commit
6ab43fdc31
6
vl.c
6
vl.c
@ -6823,12 +6823,10 @@ void main_loop_wait(int timeout)
|
|||||||
IOHandlerRecord **pioh;
|
IOHandlerRecord **pioh;
|
||||||
|
|
||||||
for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) {
|
for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) {
|
||||||
if (ioh->deleted)
|
if (!ioh->deleted && ioh->fd_read && FD_ISSET(ioh->fd, &rfds)) {
|
||||||
continue;
|
|
||||||
if (FD_ISSET(ioh->fd, &rfds)) {
|
|
||||||
ioh->fd_read(ioh->opaque);
|
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);
|
ioh->fd_write(ioh->opaque);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user