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)
{
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);
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);
else
p = path;
- ZeroMemory(containerId, sizeof(containerId));
sprintf_s((char*)containerId, sizeof(containerId), "%04" PRIX16 "%04" PRIX16 "%s", idVendor,
idProduct, p);
/* format */