aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/USBtoSerial/USBtoSerial.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-15 04:45:31 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-15 04:45:31 +0000
commite2e1fe5aad50809f00f6f5258432bd7aa605f47c (patch)
treed2c55277afd52537fafd198f4755d72ccf5dbc2c /Projects/USBtoSerial/USBtoSerial.c
parent7cef08e10e0e7ef770c52dc180b25fdfa5cf758d (diff)
downloadlufa-e2e1fe5aad50809f00f6f5258432bd7aa605f47c.tar.gz
lufa-e2e1fe5aad50809f00f6f5258432bd7aa605f47c.tar.bz2
lufa-e2e1fe5aad50809f00f6f5258432bd7aa605f47c.zip
Fixed possible buffer overrun in the XPLAINBridge project when in serial bridge mode.
Diffstat (limited to 'Projects/USBtoSerial/USBtoSerial.c')
-rw-r--r--Projects/USBtoSerial/USBtoSerial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c
index 145047cbc..1cd6f5563 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));