mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
DSD demod: fixed possible buffer overrun with sprintf
This commit is contained in:
parent
15443fb72d
commit
62cbcc3083
@ -510,7 +510,7 @@ void DSDDemodGUI::formatStatusText()
|
|||||||
}
|
}
|
||||||
memcpy(&m_formatStatusText[41], m_dsdDemod->getDecoder().getDStarDecoder().getInfoText(), 20);
|
memcpy(&m_formatStatusText[41], m_dsdDemod->getDecoder().getDStarDecoder().getInfoText(), 20);
|
||||||
memcpy(&m_formatStatusText[62], m_dsdDemod->getDecoder().getDStarDecoder().getLocator(), 6);
|
memcpy(&m_formatStatusText[62], m_dsdDemod->getDecoder().getDStarDecoder().getLocator(), 6);
|
||||||
sprintf(&m_formatStatusText[69], "%03d/%07.1f",
|
snprintf(&m_formatStatusText[69], 82-69, "%03d/%07.1f",
|
||||||
m_dsdDemod->getDecoder().getDStarDecoder().getBearing(),
|
m_dsdDemod->getDecoder().getDStarDecoder().getBearing(),
|
||||||
m_dsdDemod->getDecoder().getDStarDecoder().getDistance());
|
m_dsdDemod->getDecoder().getDStarDecoder().getDistance());
|
||||||
}
|
}
|
||||||
@ -519,7 +519,7 @@ void DSDDemodGUI::formatStatusText()
|
|||||||
m_signalFormat = signalFormatDStar;
|
m_signalFormat = signalFormatDStar;
|
||||||
break;
|
break;
|
||||||
case DSDcc::DSDDecoder::DSDSyncDPMR:
|
case DSDcc::DSDDecoder::DSDSyncDPMR:
|
||||||
sprintf(m_formatStatusText, "%s CC: %04d OI: %08d CI: %08d",
|
snprintf(m_formatStatusText, 82, "%s CC: %04d OI: %08d CI: %08d",
|
||||||
DSDcc::DSDdPMR::dpmrFrameTypes[(int) m_dsdDemod->getDecoder().getDPMRDecoder().getFrameType()],
|
DSDcc::DSDdPMR::dpmrFrameTypes[(int) m_dsdDemod->getDecoder().getDPMRDecoder().getFrameType()],
|
||||||
m_dsdDemod->getDecoder().getDPMRDecoder().getColorCode(),
|
m_dsdDemod->getDecoder().getDPMRDecoder().getColorCode(),
|
||||||
m_dsdDemod->getDecoder().getDPMRDecoder().getOwnId(),
|
m_dsdDemod->getDecoder().getDPMRDecoder().getOwnId(),
|
||||||
|
Loading…
Reference in New Issue
Block a user