Merge pull request #148 from BeigeBox/fix/uninitialized-netid

Fix uninitialized repeater ID in MMDVM outgoing packets
This commit is contained in:
Jonathan Naylor 2026-04-06 20:00:04 +01:00 committed by GitHub
commit 237201a570
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View file

@ -34,7 +34,6 @@ CMMDVMNetwork::CMMDVMNetwork(const std::string& rptAddress, unsigned short rptPo
m_rptAddr(),
m_rptAddrLen(0U),
m_id(0U),
m_netId(nullptr),
m_debug(debug),
m_socket(localAddress, localPort),
m_buffer(nullptr),
@ -53,8 +52,6 @@ m_talkerAliasLen(0U)
m_rptAddrLen = 0U;
m_buffer = new unsigned char[BUFFER_LENGTH];
m_netId = new unsigned char[4U];
m_radioPositionData = new unsigned char[50U];
m_talkerAliasData = new unsigned char[50U];
@ -64,7 +61,6 @@ m_talkerAliasLen(0U)
CMMDVMNetwork::~CMMDVMNetwork()
{
delete[] m_netId;
delete[] m_buffer;
delete[] m_configData;
delete[] m_radioPositionData;
@ -180,7 +176,10 @@ bool CMMDVMNetwork::write(const CDMRData& data)
buffer[9U] = dstId >> 8;
buffer[10U] = dstId >> 0;
::memcpy(buffer + 11U, m_netId, 4U);
buffer[11U] = m_id >> 24;
buffer[12U] = m_id >> 16;
buffer[13U] = m_id >> 8;
buffer[14U] = m_id >> 0;
unsigned int slotNo = data.getSlotNo();

View file

@ -57,7 +57,6 @@ private:
sockaddr_storage m_rptAddr;
unsigned int m_rptAddrLen;
unsigned int m_id;
unsigned char* m_netId;
bool m_debug;
CUDPSocket m_socket;
unsigned char* m_buffer;