Treat an all-zeros message as bad.
This commit is contained in:
parent
75851778c0
commit
803760ca80
4
mode_s.c
4
mode_s.c
|
@ -333,6 +333,7 @@ int scoreModesMessage(unsigned char *msg, int validbits)
|
||||||
int msgtype, msgbits, crc, iid;
|
int msgtype, msgbits, crc, iid;
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
struct errorinfo *ei;
|
struct errorinfo *ei;
|
||||||
|
static unsigned char all_zeros[14] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
if (validbits < 56)
|
if (validbits < 56)
|
||||||
return -2;
|
return -2;
|
||||||
|
@ -343,6 +344,9 @@ int scoreModesMessage(unsigned char *msg, int validbits)
|
||||||
if (validbits < msgbits)
|
if (validbits < msgbits)
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
|
if (!memcmp(all_zeros, msg, msgbits/8))
|
||||||
|
return -2;
|
||||||
|
|
||||||
crc = modesChecksum(msg, msgbits);
|
crc = modesChecksum(msg, msgbits);
|
||||||
|
|
||||||
switch (msgtype) {
|
switch (msgtype) {
|
||||||
|
|
Loading…
Reference in a new issue