diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2024-05-08 22:43:28 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2024-05-08 22:43:28 +0000 |
commit | 8c37094036a5f00301c5f5f2be475b664dd5ea23 (patch) | |
tree | a3722223cdf95aa3ef8768f1053cf1602b9ec9ed | |
parent | 83dcc7790b11e605c32ec9a091c6bba3bc921083 (diff) | |
download | src-8c37094036a5f00301c5f5f2be475b664dd5ea23.tar.gz src-8c37094036a5f00301c5f5f2be475b664dd5ea23.zip |
sctp: allow stcb == NULL in sctp_shutdown()
Consistently handle this case.
Reported by: Coverity Scan
CID: 1533813
MFC after: 3 days
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 3b0da87edce3..b9a3be5280ae 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -843,8 +843,10 @@ sctp_shutdown(struct socket *so, enum shutdown_how how) } sctp_free_a_readq(stcb, control); } else { - stcb->asoc.size_on_all_streams += - control->length; + if (stcb != NULL) { + stcb->asoc.size_on_all_streams += + control->length; + } } } SOCK_UNLOCK(so); |