From 86aead52ce2d57e8f2051b18b603e5134f9fe726 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Sun, 25 Dec 2011 17:58:37 -0500 Subject: [PATCH] usb cdc: only pass valid bytes from USB rx up to com layer Previously, up to 63 random bytes would be passed to the COM layer and would be delivered to the application as though the far end had sent them. --- flight/PiOS/STM32F10x/pios_usb_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/PiOS/STM32F10x/pios_usb_com.c b/flight/PiOS/STM32F10x/pios_usb_com.c index 8bdcbed6a..8fa56a752 100644 --- a/flight/PiOS/STM32F10x/pios_usb_com.c +++ b/flight/PiOS/STM32F10x/pios_usb_com.c @@ -481,7 +481,7 @@ static void PIOS_USB_COM_CDC_DATA_EP_OUT_Callback(void) bool need_yield = false; (usb_com_dev->rx_in_cb)(usb_com_dev->rx_in_context, usb_com_dev->rx_packet_buffer, - sizeof(usb_com_dev->rx_packet_buffer), + DataLength, &headroom, &need_yield);