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>
cppcheck reported an out-of-bounds access in APRSPacket::parseItem()
when parsing item names. The parser checked the string length using an
incorrect boundary condition, allowing an index equal to the string
length to be accessed.
Validate the item terminator before indexing the string, and ensure
malformed packets without a valid terminator are rejected. Also simplify
the item name parsing logic while enforcing the APRS 3-9 character item
name limit.
Signed-off-by: Robin Getz <rgetz503@gmail.com>