From c06f1ff1a418184d7ef8b4eb1a7fac618e1466e1 Mon Sep 17 00:00:00 2001 From: Shawn Chain Date: Mon, 20 Dec 2021 13:34:33 +0800 Subject: [PATCH] Fix SerialPort crash on large MMDVM frame(>255) --- SerialPort.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SerialPort.cpp b/SerialPort.cpp index d552efa..b96422f 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -1806,7 +1806,7 @@ void CSerialPort::writeFMData(const uint8_t* data, uint16_t length) reply[2U] = (length + 4U) - 255U; reply[3U] = MMDVM_FM_DATA; - for (uint8_t i = 0U; i < length; i++) + for (int i = 0U; i < length; i++) reply[i + 4U] = data[i]; writeInt(1U, reply, length + 4U); @@ -1875,7 +1875,7 @@ void CSerialPort::writeAX25Data(const uint8_t* data, uint16_t length) reply[2U] = (length + 4U) - 255U; reply[3U] = MMDVM_AX25_DATA; - for (uint8_t i = 0U; i < length; i++) + for (int i = 0U; i < length; i++) reply[i + 4U] = data[i]; writeInt(1U, reply, length + 4U); @@ -2110,7 +2110,7 @@ void CSerialPort::writeDebugDump(const uint8_t* data, uint16_t length) reply[2U] = (length + 4U) - 255U; reply[3U] = MMDVM_DEBUG_DUMP; - for (uint8_t i = 0U; i < length; i++) + for (int i = 0U; i < length; i++) reply[i + 4U] = data[i]; writeInt(1U, reply, length + 4U);