mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
gnrc_netif_ieee802154: check if mhr_len is lesser than nread
This commit is contained in:
parent
7169695cb5
commit
3c19aa7dfc
@ -143,7 +143,9 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
#endif
|
||||
size_t mhr_len = ieee802154_get_frame_hdr_len(pkt->data);
|
||||
|
||||
if (mhr_len == 0) {
|
||||
/* nread was checked for <= 0 before so we can safely cast it to
|
||||
* unsigned */
|
||||
if ((mhr_len == 0) || ((size_t)nread < mhr_len)) {
|
||||
DEBUG("_recv_ieee802154: illegally formatted frame received\n");
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user