mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-15 16:24:11 +02:00
Fix buffer overrun in the serial code.
This commit is contained in:
+1
-1
@@ -413,7 +413,7 @@ void CSerialPort::process()
|
|||||||
if (m_ptr == 2U)
|
if (m_ptr == 2U)
|
||||||
m_len = m_buffer[1U];
|
m_len = m_buffer[1U];
|
||||||
|
|
||||||
if (m_ptr == 3U && m_len > 230U) {
|
if (m_ptr == 3U && m_len > 250U) {
|
||||||
sendNAK(3U);
|
sendNAK(3U);
|
||||||
m_ptr = 0U;
|
m_ptr = 0U;
|
||||||
m_len = 0U;
|
m_len = 0U;
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ private:
|
|||||||
#if defined(__MBED__)
|
#if defined(__MBED__)
|
||||||
Serial m_serial;
|
Serial m_serial;
|
||||||
#endif
|
#endif
|
||||||
uint8_t m_buffer[130U];
|
uint8_t m_buffer[250U];
|
||||||
uint8_t m_ptr;
|
uint8_t m_ptr;
|
||||||
uint8_t m_len;
|
uint8_t m_len;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user