mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
usb: sanity check setup_index+setup_len in post_load
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
94c2b6aff4
commit
c60174e847
1 changed files with 4 additions and 0 deletions
|
@ -47,6 +47,10 @@ static int usb_device_post_load(void *opaque, int version_id)
|
||||||
} else {
|
} else {
|
||||||
dev->attached = 1;
|
dev->attached = 1;
|
||||||
}
|
}
|
||||||
|
if (dev->setup_index >= sizeof(dev->data_buf) ||
|
||||||
|
dev->setup_len >= sizeof(dev->data_buf)) {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue