]> git.ipfire.org Git - thirdparty/qemu.git/commit - monitor.c
monitor: fix use after free
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 17 Aug 2014 09:45:17 +0000 (11:45 +0200)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 18 Aug 2014 18:39:10 +0000 (14:39 -0400)
commitb3dd1b8c295636e64ceb14cdc4db6420d7319e38
treee8455dfc57b74258a99088394bf2c6ba9a57ed40
parent2928207ac1bb2751a1554ea0f9a9641179f51488
monitor: fix use after free

The function monitor_fdset_dup_fd_find_remove() references member of
'mon_fdset' which - when remove flag is set - may be freed in function
monitor_fdset_cleanup().
remove is set by monitor_fdset_dup_fd_remove which in practice
does not need the returned value, so make it void,
and return -1 from monitor_fdset_dup_fd_find_remove.

Reported-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
include/monitor/monitor.h
monitor.c
stubs/fdset-remove-fd.c