summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2023-09-29 11:42:35 +0200
committerGravatar Nikias Bassen2023-09-29 11:42:35 +0200
commitb5dfb25dd464527e68b78daffe34766a1ed7b281 (patch)
tree0e0581801274608d8e881e35f289d11657b8afde
parentc7a0dd9b82633ea347497626282e3051a469ef50 (diff)
downloadusbmuxd-b5dfb25dd464527e68b78daffe34766a1ed7b281.tar.gz
usbmuxd-b5dfb25dd464527e68b78daffe34766a1ed7b281.tar.bz2
usb: Make sure buffer for vendor specific request is 0-initialized
-rw-r--r--src/usb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usb.c b/src/usb.c
index dfea3dd..63d0208 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -369,7 +369,7 @@ static int submit_vendor_specific(struct libusb_device_handle *handle, struct mo
{
struct libusb_transfer* ctrl_transfer = libusb_alloc_transfer(0);
int ret = 0;
- unsigned char* buffer = malloc(LIBUSB_CONTROL_SETUP_SIZE + context->wLength);
+ unsigned char* buffer = calloc(LIBUSB_CONTROL_SETUP_SIZE + context->wLength, 1);
uint8_t bRequestType = LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN | LIBUSB_RECIPIENT_DEVICE;
libusb_fill_control_setup(buffer, bRequestType, context->bRequest, context->wValue, context->wIndex, context->wLength);