Replaced memset in urbdrc

This commit is contained in:
akallabeth 2020-07-03 15:47:53 +02:00 committed by akallabeth
parent 29e3b0ea51
commit 37a5a7a157
2 changed files with 3 additions and 6 deletions

View File

@ -561,8 +561,7 @@ libusb_udev_complete_msconfig_setup(IUDEVICE* idev, MSUSB_CONFIG_DESCRIPTOR* MsC
for (pnum = 0; pnum < LibusbNumEndpoint; pnum++)
{
t_MsPipe = (MSUSB_PIPE_DESCRIPTOR*)malloc(sizeof(MSUSB_PIPE_DESCRIPTOR));
memset(t_MsPipe, 0, sizeof(MSUSB_PIPE_DESCRIPTOR));
t_MsPipe = (MSUSB_PIPE_DESCRIPTOR*)calloc(1, sizeof(MSUSB_PIPE_DESCRIPTOR));
if (pnum < MsInterface->NumberOfPipes && MsInterface->MsPipes)
{
@ -863,12 +862,11 @@ static int libusb_udev_os_feature_descriptor_request(IUDEVICE* idev, UINT32 Requ
BYTE* Buffer, int Timeout)
{
UDEVICE* pdev = (UDEVICE*)idev;
BYTE ms_string_desc[0x13];
BYTE ms_string_desc[0x13] = { 0 };
int error = 0;
/*
pdev->request_queue->register_request(pdev->request_queue, RequestId, NULL, 0);
*/
memset(ms_string_desc, 0, 0x13);
error = libusb_control_transfer(pdev->libusb_handle, LIBUSB_ENDPOINT_IN | Recipient,
LIBUSB_REQUEST_GET_DESCRIPTOR, 0x03ee, 0, ms_string_desc, 0x12,
Timeout);

View File

@ -86,7 +86,7 @@ static IWTSVirtualChannel* get_channel(IUDEVMAN* idevman)
static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId)
{
char *p, *path;
UINT8 containerId[17];
UINT8 containerId[17] = { 0 };
UINT16 idVendor, idProduct;
idVendor = (UINT16)pdev->query_device_descriptor(pdev, ID_VENDOR);
idProduct = (UINT16)pdev->query_device_descriptor(pdev, ID_PRODUCT);
@ -97,7 +97,6 @@ static int func_container_id_generate(IUDEVICE* pdev, char* strContainerId)
else
p = path;
ZeroMemory(containerId, sizeof(containerId));
sprintf_s((char*)containerId, sizeof(containerId), "%04" PRIX16 "%04" PRIX16 "%s", idVendor,
idProduct, p);
/* format */