Skip to content

Commit

Permalink
ioctl: Allow ZLP control writes
Browse files Browse the repository at this point in the history
Closes mcuee#21

Signed-off-by: Tormod Volden <[email protected]>
  • Loading branch information
tormodvolden committed Oct 13, 2021
1 parent ee27cd5 commit 9acdc23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libusb/src/driver/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,9 @@ NULL : input_buffer + sizeof(libusb_request),

dispCtlCode = "CONTROL_WRITE";

// check if the request and buffer is valid
if (!request || !transfer_buffer_mdl || input_buffer_length < sizeof(libusb_request))
/* we don't check 'transfer_buffer_mdl' here because it might be NULL */
/* if the DLL requests to send a zero-length control packet */
if (!request || input_buffer_length < sizeof(libusb_request))
{
USBERR("%s: invalid transfer request\n", dispCtlCode);
status = STATUS_INVALID_PARAMETER;
Expand Down

0 comments on commit 9acdc23

Please sign in to comment.