Question
stm32f2xx USB potential bug
Posted on June 21, 2013 at 13:59 search for CBW_CB_LENGTH typedef union _USBH_CBW_Block { struct __CBW { uint32_t CBWSignature; uint32_t CBWTag; uint32_t CBWTransferLength; uint8_t CBWFlags; uint8_t CBWLUN; uint8_t CBWLength; uint8_t CBWCB[16]; }field; uint8_t CBWArray[31]; }HostCBWPkt_TypeDef; both are used in the code as follows for(index = CBW_CB_LENGTH; index != 0; index--) { USBH_MSC_CBWData.field.CBWCB[index] = 0x00; } lint produces the following Warning 661: Possible access of out-of-bounds pointer (1 beyond end of data) by operator '[' [Reference: file ..\..\STM32_USB_HOST_Library\Class\MSC\src\usbh_msc_scsi.c: lines 307, 309] anyone know why the code has been written this way
