fixed unsafe use of CDC_Send(... buf, uint8_t count): count was only an uint8_t, passing arbitrary non 8-bit integers failed. use uint32_t instead - fixes 1899
This commit is contained in:
parent
1771a97d86
commit
0dbf72f9fb
|
@ -111,7 +111,7 @@ static void usbVcpWriteBuf(serialPort_t *instance, const void *data, int count)
|
|||
|
||||
static bool usbVcpFlush(vcpPort_t *port)
|
||||
{
|
||||
uint8_t count = port->txAt;
|
||||
uint32_t count = port->txAt;
|
||||
port->txAt = 0;
|
||||
|
||||
if (count == 0) {
|
||||
|
|
|
@ -282,7 +282,7 @@ static void IntToUnicode(uint32_t value, uint8_t *pbuf, uint8_t len)
|
|||
* Output : None.
|
||||
* Return : None.
|
||||
*******************************************************************************/
|
||||
uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint8_t sendLength)
|
||||
uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint32_t sendLength)
|
||||
{
|
||||
/* Last transmission hasn't finished, abort */
|
||||
if (packetSent) {
|
||||
|
|
|
@ -55,7 +55,7 @@ void Leave_LowPowerMode(void);
|
|||
void USB_Interrupts_Config(void);
|
||||
void USB_Cable_Config(FunctionalState NewState);
|
||||
void Get_SerialNum(void);
|
||||
uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint8_t sendLength); // HJI
|
||||
uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint32_t sendLength); // HJI
|
||||
uint32_t CDC_Send_FreeBytes(void);
|
||||
uint32_t CDC_Receive_DATA(uint8_t* recvBuf, uint32_t len); // HJI
|
||||
uint32_t CDC_Receive_BytesAvailable(void);
|
||||
|
|
Loading…
Reference in New Issue