From a1b51d4dffdfafef5217a5f65c6cb60ab9804045 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 12 Sep 2016 23:16:04 +0100 Subject: [PATCH] Fix buffer overrun in the serial code. --- SerialPort.cpp | 2 +- SerialPort.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SerialPort.cpp b/SerialPort.cpp index 86259c3..529f5dd 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -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; diff --git a/SerialPort.h b/SerialPort.h index 5ad3881..d4981e7 100644 --- a/SerialPort.h +++ b/SerialPort.h @@ -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;