提交 a14ff8a6 编写于 作者: G Gerd Hoffmann

usb-redir: fix use-after-free

Reinitialize dev->cs to NULL after deleting it, to make sure it isn't
used afterwards.
Reported-by: NMartin Cerveny <M.Cerveny@computer.org>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 75cc1c1f
......@@ -1334,6 +1334,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev);
qemu_chr_delete(dev->cs);
dev->cs = NULL;
/* Note must be done after qemu_chr_close, as that causes a close event */
qemu_bh_delete(dev->chardev_close_bh);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册