Merge pull request #12203 from deReeperJosh/hidv4-check-device-not-null
HIDv4: Check Device Not Null Before Attaching
This commit is contained in:
commit
467c7435d1
|
@ -59,6 +59,8 @@ std::optional<IPCReply> USB_HIDv4::IOCtl(const IOCtlRequest& request)
|
||||||
if (request.buffer_in == 0 || request.buffer_in_size != 32)
|
if (request.buffer_in == 0 || request.buffer_in_size != 32)
|
||||||
return IPCReply(IPC_EINVAL);
|
return IPCReply(IPC_EINVAL);
|
||||||
const auto device = GetDeviceByIOSID(memory.Read_U32(request.buffer_in + 16));
|
const auto device = GetDeviceByIOSID(memory.Read_U32(request.buffer_in + 16));
|
||||||
|
if (!device)
|
||||||
|
return IPCReply(IPC_ENOENT);
|
||||||
if (!device->Attach())
|
if (!device->Attach())
|
||||||
return IPCReply(IPC_EINVAL);
|
return IPCReply(IPC_EINVAL);
|
||||||
return HandleTransfer(device, request.request,
|
return HandleTransfer(device, request.request,
|
||||||
|
|
Loading…
Reference in New Issue