Merge pull request #294 from g-oikonomou/bugfix/ieee-mode-frame-length

Correctly check against minumum RX frame length
This commit is contained in:
George Oikonomou 2018-02-16 15:41:53 +00:00 committed by GitHub
commit 36f8cb24cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1079,17 +1079,17 @@ read_frame(void *buf, unsigned short buf_len)
return 0; return 0;
} }
if(rx_read_entry[8] < 4) { len = rx_read_entry[8] - 8;
PRINTF("RF: too short\n");
if(len > buf_len) {
PRINTF("RF: too long\n");
release_data_entry(); release_data_entry();
return 0; return 0;
} }
len = rx_read_entry[8] - 8; if(len < 5) {
PRINTF("RF: too short\n");
if(len > buf_len) {
PRINTF("RF: too long\n");
release_data_entry(); release_data_entry();
return 0; return 0;