Add stricter P25 id checking.

This commit is contained in:
Jonathan Naylor
2017-08-19 12:37:32 +01:00
parent 23ce9c7b46
commit afe38bcb9d
5 changed files with 28 additions and 24 deletions

View File

@@ -71,7 +71,7 @@ void CP25Data::encodeHeader(unsigned char* data)
CP25Utils::encode(DUMMY_HEADER, data, 114U, 780U);
}
bool CP25Data::decodeLDU1(const unsigned char* data, bool m_network, bool m_uidOverride)
bool CP25Data::decodeLDU1(const unsigned char* data)
{
assert(data != NULL);
@@ -105,12 +105,7 @@ bool CP25Data::decodeLDU1(const unsigned char* data, bool m_network, bool m_uidO
return false;
}
// Simple validation of the source id - does not check if no network
unsigned int srcId = (rs[6U] << 16) + (rs[7U] << 8) + rs[8U];
if (m_network || (!m_network && !m_uidOverride)) {
if (srcId < 1000000U)
return false;
}
switch (rs[0U]) {
case P25_LCF_GROUP: