Fix buffer overrun in the serial code.

This commit is contained in:
Jonathan Naylor 2016-09-12 23:16:04 +01:00
parent f4262c3a24
commit a1b51d4dff
2 changed files with 2 additions and 2 deletions

View File

@ -413,7 +413,7 @@ void CSerialPort::process()
if (m_ptr == 2U)
m_len = m_buffer[1U];
if (m_ptr == 3U && m_len > 230U) {
if (m_ptr == 3U && m_len > 250U) {
sendNAK(3U);
m_ptr = 0U;
m_len = 0U;

View File

@ -60,7 +60,7 @@ private:
#if defined(__MBED__)
Serial m_serial;
#endif
uint8_t m_buffer[130U];
uint8_t m_buffer[250U];
uint8_t m_ptr;
uint8_t m_len;