[AX25] Fix possible string truncation
This commit is contained in:
parent
76f61144df
commit
60d1738c91
1 changed files with 4 additions and 4 deletions
|
@ -59,8 +59,8 @@ AX25Frame::AX25Frame(const AX25Frame& frame)
|
||||||
infoLen(frame.infoLen),
|
infoLen(frame.infoLen),
|
||||||
rcvSeqNumber(frame.rcvSeqNumber),
|
rcvSeqNumber(frame.rcvSeqNumber),
|
||||||
sendSeqNumber(frame.sendSeqNumber) {
|
sendSeqNumber(frame.sendSeqNumber) {
|
||||||
strncpy(this->destCallsign, frame.destCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN);
|
strncpy(this->destCallsign, frame.destCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN + 1);
|
||||||
strncpy(this->srcCallsign, frame.srcCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN);
|
strncpy(this->srcCallsign, frame.srcCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN + 1);
|
||||||
|
|
||||||
if(frame.infoLen) {
|
if(frame.infoLen) {
|
||||||
#if !RADIOLIB_STATIC_ONLY
|
#if !RADIOLIB_STATIC_ONLY
|
||||||
|
@ -204,7 +204,7 @@ AX25Client::AX25Client(const AX25Client& ax25)
|
||||||
: phyLayer(ax25.phyLayer),
|
: phyLayer(ax25.phyLayer),
|
||||||
sourceSSID(ax25.sourceSSID),
|
sourceSSID(ax25.sourceSSID),
|
||||||
preambleLen(ax25.preambleLen) {
|
preambleLen(ax25.preambleLen) {
|
||||||
strncpy(sourceCallsign, ax25.sourceCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN);
|
strncpy(sourceCallsign, ax25.sourceCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN + 1);
|
||||||
#if !RADIOLIB_EXCLUDE_AFSK
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
if(ax25.bellModem) {
|
if(ax25.bellModem) {
|
||||||
this->audio = ax25.audio;
|
this->audio = ax25.audio;
|
||||||
|
@ -217,7 +217,7 @@ AX25Client& AX25Client::operator=(const AX25Client& ax25) {
|
||||||
this->phyLayer = ax25.phyLayer;
|
this->phyLayer = ax25.phyLayer;
|
||||||
this->sourceSSID = ax25.sourceSSID;
|
this->sourceSSID = ax25.sourceSSID;
|
||||||
this->preambleLen = ax25.preambleLen;
|
this->preambleLen = ax25.preambleLen;
|
||||||
strncpy(sourceCallsign, ax25.sourceCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN);
|
strncpy(sourceCallsign, ax25.sourceCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN + 1);
|
||||||
#if !RADIOLIB_EXCLUDE_AFSK
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
if(ax25.bellModem) {
|
if(ax25.bellModem) {
|
||||||
this->audio = ax25.audio;
|
this->audio = ax25.audio;
|
||||||
|
|
Loading…
Add table
Reference in a new issue