mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20140613-1' into staging
usb-host: add range checks for usb-host parameters # gpg: Signature made Fri 13 Jun 2014 12:33:05 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20140613-1: usb-host: add range checks for usb-host parameters Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -952,6 +952,19 @@ static int usb_host_initfn(USBDevice *udev)
|
||||
{
|
||||
USBHostDevice *s = USB_HOST_DEVICE(udev);
|
||||
|
||||
if (s->match.vendor_id > 0xffff) {
|
||||
error_report("vendorid out of range");
|
||||
return -1;
|
||||
}
|
||||
if (s->match.product_id > 0xffff) {
|
||||
error_report("productid out of range");
|
||||
return -1;
|
||||
}
|
||||
if (s->match.addr > 127) {
|
||||
error_report("hostaddr out of range");
|
||||
return -1;
|
||||
}
|
||||
|
||||
loglevel = s->loglevel;
|
||||
udev->flags |= (1 << USB_DEV_FLAG_IS_HOST);
|
||||
udev->auto_attach = 0;
|
||||
|
||||
Reference in New Issue
Block a user