Commit fbe0c559 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin
Browse files

virtio-serial: don't crash on invalid input

Fix crash on invalid input in virtio-serial.
Discovered by code review, untested.
Signed-off-by: default avatarMichael S. Tsirkin <>
parent 6cdfab28
......@@ -594,6 +594,9 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
id = qemu_get_be32(f);
port = find_port_by_id(s, id);
if (!port) {
return -EINVAL;
port->guest_connected = qemu_get_byte(f);
host_connected = qemu_get_byte(f);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment