From 26c484d668e3629fdf146be91a7d171fa5916135 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Sat, 1 Aug 2026 23:26:54 -0400 Subject: [PATCH] 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 --- sdrbase/util/aprs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrbase/util/aprs.cpp b/sdrbase/util/aprs.cpp index 2f810ad36..e8dae7862 100644 --- a/sdrbase/util/aprs.cpp +++ b/sdrbase/util/aprs.cpp @@ -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;