mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
gnrc_tcp: add minimum length check to _receive
This commit is contained in:
parent
97de3e835b
commit
0fff1b35ec
@ -136,6 +136,12 @@ static int _receive(gnrc_pktsnip_t *pkt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tcp->size < sizeof(tcp_hdr_t)) {
|
||||
DEBUG("gnrc_tcp_eventloop.c : _receive() : packet is too short\n");
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
/* Extract control bits, src and dst ports and check if SYN is set (not SYN+ACK) */
|
||||
hdr = (tcp_hdr_t *)tcp->data;
|
||||
ctl = byteorder_ntohs(hdr->off_ctl);
|
||||
|
Loading…
Reference in New Issue
Block a user