diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-07-15 04:45:31 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-07-15 04:45:31 +0000 |
| commit | a1ffc53e4e76b56d295e76fd9a8c2b95952693f8 (patch) | |
| tree | d2c55277afd52537fafd198f4755d72ccf5dbc2c /Projects/USBtoSerial/USBtoSerial.c | |
| parent | a0056f6ef2b36eedc2e717406283b4aa2b6fd32e (diff) | |
Fixed possible buffer overrun in the XPLAINBridge project when in serial bridge mode.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1388 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects/USBtoSerial/USBtoSerial.c')
| -rw-r--r-- | Projects/USBtoSerial/USBtoSerial.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c index 145047cb..1cd6f556 100644 --- a/Projects/USBtoSerial/USBtoSerial.c +++ b/Projects/USBtoSerial/USBtoSerial.c @@ -84,7 +84,7 @@ int main(void) /* Read bytes from the USB OUT endpoint into the USART transmit buffer */ for (uint8_t DataBytesRem = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface); DataBytesRem != 0; DataBytesRem--) { - if (!(BUFFER_SIZE - USBtoUSART_Buffer.Count)) + if (RingBuffer_IsFull(&USBtoUSART_Buffer)) break; RingBuffer_AtomicInsert(&USBtoUSART_Buffer, CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface)); |
