mirror of
https://github.com/g4klx/DMRGateway
synced 2025-12-22 06:05:36 +08:00
avoid invalid lat/lon/height values increasing RPTC pkt len
This commit is contained in:
@@ -2422,12 +2422,18 @@ unsigned int CDMRGateway::getConfig(const std::string& name, unsigned char* buff
|
|||||||
assert(buffer != NULL);
|
assert(buffer != NULL);
|
||||||
|
|
||||||
float lat = m_conf.getInfoLatitude();
|
float lat = m_conf.getInfoLatitude();
|
||||||
|
if ((lat > 90) || (lat < -90))
|
||||||
|
lat = 0;
|
||||||
|
|
||||||
float lon = m_conf.getInfoLongitude();
|
float lon = m_conf.getInfoLongitude();
|
||||||
|
if ((lon > 180) || (lon < -180))
|
||||||
|
lon = 0;
|
||||||
|
|
||||||
int height = m_conf.getInfoHeight();
|
int height = m_conf.getInfoHeight();
|
||||||
if (height > 999)
|
if (height > 999)
|
||||||
height = 999;
|
height = 999;
|
||||||
|
else if (height < 0)
|
||||||
|
height = 0;
|
||||||
|
|
||||||
std::string location = m_conf.getInfoLocation();
|
std::string location = m_conf.getInfoLocation();
|
||||||
std::string description = m_conf.getInfoDescription();
|
std::string description = m_conf.getInfoDescription();
|
||||||
|
|||||||
Reference in New Issue
Block a user