From b3dd1b8c295636e64ceb14cdc4db6420d7319e38 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 17 Aug 2014 11:45:17 +0200 Subject: 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 Signed-off-by: Michael S. Tsirkin Signed-off-by: Luiz Capitulino --- stubs/fdset-remove-fd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'stubs/fdset-remove-fd.c') diff --git a/stubs/fdset-remove-fd.c b/stubs/fdset-remove-fd.c index b3886d9f45..7f6d61e619 100644 --- a/stubs/fdset-remove-fd.c +++ b/stubs/fdset-remove-fd.c @@ -1,7 +1,6 @@ #include "qemu-common.h" #include "monitor/monitor.h" -int monitor_fdset_dup_fd_remove(int dupfd) +void monitor_fdset_dup_fd_remove(int dupfd) { - return -1; } -- cgit v1.2.1