stm32: cdcacm: fix array out of bounds write

Remove debug leftovers that were causing memory corruption.
Writes of 64 or more bytes from the USB host side caused memory
corruption before this commit.
I've tested it in a STM32L4 board and it is working as expected.
This commit is contained in:
Santiago Piccinini
2021-01-17 18:59:48 -03:00
parent 4b4115fd72
commit 882f5b7d1b
6 changed files with 0 additions and 6 deletions

View File

@@ -213,7 +213,6 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
if (len) {
while (usbd_ep_write_packet(usbd_dev, 0x82, buf, len) == 0)
;
buf[len] = 0;
}
gpio_toggle(GPIOC, GPIO5);

View File

@@ -212,7 +212,6 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
if (len) {
usbd_ep_write_packet(usbd_dev, 0x82, buf, len);
buf[len] = 0;
}
}

View File

@@ -212,7 +212,6 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
if (len) {
usbd_ep_write_packet(usbd_dev, 0x82, buf, len);
buf[len] = 0;
}
}

View File

@@ -213,7 +213,6 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
if (len) {
usbd_ep_write_packet(usbd_dev, 0x82, buf, len);
buf[len] = 0;
}
}

View File

@@ -224,7 +224,6 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
if (len) {
usbd_ep_write_packet(usbd_dev, 0x82, buf, len);
buf[len] = 0;
}
}

View File

@@ -212,7 +212,6 @@ static void cdcacm_data_rx_cb(usbd_device *usbd_dev, uint8_t ep)
if (len) {
usbd_ep_write_packet(usbd_dev, 0x82, buf, len);
buf[len] = 0;
}
}