mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-08-12 22:43:36 -04:00
AIS: Validate message length. Fixes #2125
This commit is contained in:
@@ -179,6 +179,10 @@ QString AISMessage::typeToString(quint8 type)
|
||||
|
||||
AISMessage* AISMessage::decode(const QByteArray ba)
|
||||
{
|
||||
if (ba.size() < 1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int id = (ba[0] >> 2) & 0x3f;
|
||||
|
||||
if ((id == 1) || (id == 2) || (id == 3)) {
|
||||
|
||||
Reference in New Issue
Block a user