Skip to content

Commit 52cfc0d

Browse files
authored
check for bad mac command
fix #485
1 parent cabf6fb commit 52cfc0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lmic/lmic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ scan_mac_cmds(
884884

885885
/* compute length, and exit for illegal commands */
886886
int const cmdlen = getMacCmdSize(cmd);
887-
if (cmdlen > olen - oidx) {
887+
if (cmdlen == 0 || cmdlen > olen - oidx) {
888888
// "the first unknown command terminates processing"
889889
olen = oidx;
890890
break;

0 commit comments

Comments
 (0)