1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-10 13:33:49 -04:00

aprs: Fix out-of-bounds access when parsing BITS telemetry

cppcheck reported a possible out-of-bounds access in the BITS telemetry
message parser. The bounds check was reversed, causing m_message[i] to
be accessed when i was beyond the end of the string.

Correct the condition so missing bit sense values continue to use the
existing default value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
This commit is contained in:
Robin Getz
2026-08-01 23:26:54 -04:00
parent 08ff033dc3
commit 26c484d668
+1 -1
View File
@@ -953,7 +953,7 @@ bool APRSPacket::parseMessage(QString& info, int& idx)
int i = 5;
for (int j = 0; j < 8; j++)
{
if (i >= m_message.length())
if (i < m_message.length())
m_telemetryBitSense[j] = m_message[i] == '1';
else
m_telemetryBitSense[j] = true;