mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-29 03:24:36 +00:00
sys_usbd: Added buffer null check for sys_usbd_transfer_data()
This commit is contained in:
parent
d2dc57585c
commit
0e64c74a78
@ -983,10 +983,32 @@ error_code sys_usbd_transfer_data(ppu_thread& ppu, u32 handle, u32 id_pipe, vm::
|
||||
}
|
||||
|
||||
// Claiming interface
|
||||
if (request->bmRequestType == 0 && request->bRequest == 0x09)
|
||||
switch (request->bmRequestType)
|
||||
{
|
||||
pipe.device->set_configuration(static_cast<u8>(+request->wValue));
|
||||
pipe.device->set_interface(0);
|
||||
case LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE:
|
||||
{
|
||||
switch (request->bRequest)
|
||||
{
|
||||
case LIBUSB_REQUEST_SET_CONFIGURATION:
|
||||
{
|
||||
pipe.device->set_configuration(static_cast<u8>(+request->wValue));
|
||||
pipe.device->set_interface(0);
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE:
|
||||
{
|
||||
if (!buf)
|
||||
{
|
||||
sys_usbd.error("Invalid buffer for control_transfer");
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
pipe.device->control_transfer(request->bmRequestType, request->bRequest, request->wValue, request->wIndex, request->wLength, buf_size, buf.get_ptr(), &transfer);
|
||||
|
Loading…
Reference in New Issue
Block a user