mirror of
https://github.com/g4klx/DMRGateway.git
synced 2026-04-09 00:13:46 +00:00
Merge pull request #143 from BeigeBox/fix/stack-overflow-radio-position
Fix stack buffer overflow in DMRNetwork radio position and talker alias writes
This commit is contained in:
commit
3dd99d6952
1 changed files with 6 additions and 0 deletions
|
|
@ -252,6 +252,9 @@ bool CDMRNetwork::writeRadioPosition(const unsigned char* data, unsigned int len
|
|||
if (!m_location)
|
||||
return false;
|
||||
|
||||
if (length < 4U || length > 46U)
|
||||
return false;
|
||||
|
||||
unsigned char buffer[50U];
|
||||
|
||||
::memcpy(buffer + 0U, "DMRG", 4U);
|
||||
|
|
@ -268,6 +271,9 @@ bool CDMRNetwork::writeTalkerAlias(const unsigned char* data, unsigned int lengt
|
|||
if (m_status != STATUS::RUNNING)
|
||||
return false;
|
||||
|
||||
if (length < 4U || length > 46U)
|
||||
return false;
|
||||
|
||||
unsigned char buffer[50U];
|
||||
|
||||
::memcpy(buffer + 0U, "DMRA", 4U);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue