mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-25 05:38:39 -04:00
#2028 - Check for Cr or LF.
This commit is contained in:
parent
4d3e9889ec
commit
eac144acba
@ -185,7 +185,7 @@ bool APRSPacket::decode(AX25Packet packet)
|
||||
qDebug() << "APRSPacket::decode: AX.25 Destination did not match known regexp " << m_to;
|
||||
}
|
||||
} else {
|
||||
qDebug() << "APRSPacket::decode: Not ARPS: type=" << packet.m_type << " pid=" << packet.m_pid << " length=" << packet.m_data.length();
|
||||
qDebug() << "APRSPacket::decode: Not APRS: type=" << packet.m_type << " pid=" << packet.m_pid << " length=" << packet.m_data.length();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -261,17 +261,17 @@ struct SDRBASE_API APRSPacket {
|
||||
data.append(':');
|
||||
|
||||
// #2028 - Protect against APRS-IS server command injection, by only sending up to first CR/LF
|
||||
int idx = m_data.indexOf("\r\n");
|
||||
if (idx >= 0)
|
||||
{
|
||||
data.append(m_data.left(idx + 2));
|
||||
int idx = m_data.indexOf("\r");
|
||||
if (idx == -1) {
|
||||
idx = m_data.indexOf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (idx >= 0) {
|
||||
data.append(m_data.left(idx));
|
||||
} else {
|
||||
data.append(m_data);
|
||||
data.append('\r');
|
||||
data.append('\n');
|
||||
}
|
||||
data.append('\r');
|
||||
data.append('\n');
|
||||
|
||||
return data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user