From 8bb0b0446c11ffb3bf8ac4d5b541748fe8fda1de Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 24 Jun 2024 13:25:30 -0400 Subject: [PATCH] more 3rd party filtering --- src/aprs_is_utils.cpp | 2 +- src/digi_utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aprs_is_utils.cpp b/src/aprs_is_utils.cpp index 10558b2..27b0711 100644 --- a/src/aprs_is_utils.cpp +++ b/src/aprs_is_utils.cpp @@ -177,7 +177,7 @@ namespace APRS_IS_Utils { if (packet != "") { if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) { int firstColonIndex = packet.indexOf(":"); - if (firstColonIndex > 0 && firstColonIndex < packet.length() && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) { + if (firstColonIndex > 5 && firstColonIndex < (packet.length() - 1) && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) { const String& Sender = packet.substring(3, packet.indexOf(">")); if (Sender != Config.callsign && Utils::checkValidCallsign(Sender)) { STATION_Utils::updateLastHeard(Sender); diff --git a/src/digi_utils.cpp b/src/digi_utils.cpp index 177aceb..fa70c53 100644 --- a/src/digi_utils.cpp +++ b/src/digi_utils.cpp @@ -63,7 +63,7 @@ namespace DIGI_Utils { bool thirdPartyPacket = false; String temp, Sender; int firstColonIndex = packet.indexOf(":"); - if (firstColonIndex > 0 && firstColonIndex < packet.length() && packet[firstColonIndex + 1] == '}' && packet.indexOf("TCPIP") > 0) { // 3rd Party + if (firstColonIndex > 5 && firstColonIndex < (packet.length() - 1) && packet[firstColonIndex + 1] == '}' && packet.indexOf("TCPIP") > 0) { // 3rd Party thirdPartyPacket = true; temp = packet.substring(packet.indexOf(":}") + 2); Sender = temp.substring(0, temp.indexOf(">"));