correct FACCH buffer overflow;

pull/133/head
Bryan Biedenkapp 2 months ago
parent 28dd3ce50e
commit a27e87ede1

@ -107,7 +107,7 @@ void HostBridge::processNXDNNetwork(uint8_t* buffer, uint32_t length)
facch.getData(lcBuffer);
lc::RTCH lc;
lc.decode(lcBuffer, NXDN_FACCH1_FEC_LENGTH_BITS);
lc.decode(lcBuffer, NXDN_FACCH1_LENGTH_BITS);
if (lc.getMessageType() == MessageType::RTCH_VCALL) {
m_rxNXDNLC = lc;

@ -107,6 +107,12 @@ void RTCH::decode(const uint8_t* data, uint32_t length, uint32_t offset)
{
assert(data != nullptr);
if (length > NXDN_RTCH_LC_LENGTH_BITS) {
LogError(LOG_NXDN, "RTCH::decode(), invalid LC length, len = %u, maximum = %u",
length, NXDN_RTCH_LC_LENGTH_BITS);
return;
}
uint8_t rtch[NXDN_RTCH_LC_LENGTH_BYTES];
::memset(rtch, 0x00U, NXDN_RTCH_LC_LENGTH_BYTES);

@ -148,7 +148,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
uint8_t buffer[10U];
facch.getData(buffer);
lc.decode(buffer, NXDN_FACCH1_FEC_LENGTH_BITS);
lc.decode(buffer, NXDN_FACCH1_LENGTH_BITS);
}
} else {
channel::FACCH1 facch;
@ -173,7 +173,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
uint8_t buffer[10U];
facch.getData(buffer);
lc.decode(buffer, NXDN_FACCH1_FEC_LENGTH_BITS);
lc.decode(buffer, NXDN_FACCH1_LENGTH_BITS);
}
}
}

@ -321,7 +321,7 @@ bool Voice::process(FuncChannelType::E fct, ChOption::E option, uint8_t* data, u
facch.getData(buffer);
lc::RTCH lc;
lc.decode(buffer, NXDN_FACCH1_FEC_LENGTH_BITS);
lc.decode(buffer, NXDN_FACCH1_LENGTH_BITS);
hasInfo = lc.getMessageType() == MessageType::RTCH_VCALL;
if (!hasInfo)
@ -668,7 +668,7 @@ bool Voice::processNetwork(FuncChannelType::E fct, ChOption::E option, lc::RTCH&
facch.getData(buffer);
lc::RTCH lc;
lc.decode(buffer, NXDN_FACCH1_FEC_LENGTH_BITS);
lc.decode(buffer, NXDN_FACCH1_LENGTH_BITS);
uint16_t dstId = lc.getDstId();
uint16_t srcId = lc.getSrcId();
bool group = lc.getGroup();
@ -854,7 +854,7 @@ bool Voice::processNetwork(FuncChannelType::E fct, ChOption::E option, lc::RTCH&
facch.getData(buffer);
lc::RTCH lc;
lc.decode(buffer, NXDN_FACCH1_FEC_LENGTH_BITS);
lc.decode(buffer, NXDN_FACCH1_LENGTH_BITS);
hasInfo = lc.getMessageType() == MessageType::RTCH_VCALL;
if (!hasInfo)

Loading…
Cancel
Save

Powered by TurnKey Linux.