net: tcp2: Guard against th_get() on NULL pkt
This problem was overlooked earlier and was found while testing TCP2 client side. Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
This commit is contained in:
parent
1eccf22526
commit
038618dbc8
1 changed files with 1 additions and 1 deletions
|
@ -993,7 +993,7 @@ err:
|
||||||
/* TCP state machine, everything happens here */
|
/* TCP state machine, everything happens here */
|
||||||
static void tcp_in(struct tcp *conn, struct net_pkt *pkt)
|
static void tcp_in(struct tcp *conn, struct net_pkt *pkt)
|
||||||
{
|
{
|
||||||
struct tcphdr *th = th_get(pkt);
|
struct tcphdr *th = pkt ? th_get(pkt) : NULL;
|
||||||
u8_t next = 0, fl = th ? th->th_flags : 0;
|
u8_t next = 0, fl = th ? th->th_flags : 0;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue