net: tcp: validate pointer before dereferencing it
See https://habr.com/en/company/pvs-studio/blog/495284/ fragment 8. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
adb13b7d65
commit
cbce6dde4c
1 changed files with 1 additions and 0 deletions
|
@ -1506,6 +1506,7 @@ int net_tcp_put(struct net_context *context)
|
|||
if (net_context_get_ip_proto(context) == IPPROTO_TCP) {
|
||||
if ((net_context_get_state(context) == NET_CONTEXT_CONNECTED ||
|
||||
net_context_get_state(context) == NET_CONTEXT_LISTENING)
|
||||
&& context->tcp
|
||||
&& !context->tcp->fin_rcvd) {
|
||||
NET_DBG("TCP connection in active close, not "
|
||||
"disposing yet (waiting %dms)", FIN_TIMEOUT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue