diff options
author | tuexen <tuexen@FreeBSD.org> | 2016-02-17 18:12:38 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2016-02-17 18:12:38 +0000 |
commit | 0a576daa3e1a1006befbaa37f98b354b34ec5828 (patch) | |
tree | f668e4128c0301e038d6ac01fe670e1c7e91f203 | |
parent | 5e6759fc0054d1836042a76e2defb9d14ac275b5 (diff) | |
download | FreeBSD-src-0a576daa3e1a1006befbaa37f98b354b34ec5828.zip FreeBSD-src-0a576daa3e1a1006befbaa37f98b354b34ec5828.tar.gz |
Add protection code for issues reported by PVS / D5245.
MFC after: 3 days
-rw-r--r-- | sys/netinet/sctp_input.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index a6f625d..ddb563c 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -909,7 +909,9 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp, return; } #endif - sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); + if (stcb->sctp_socket) { + sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); + } #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif @@ -4858,7 +4860,7 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { - if (locked_tcb != stcb) { + if ((locked_tcb != NULL) && (locked_tcb != stcb)) { /* Very unlikely */ SCTP_TCB_UNLOCK(locked_tcb); } |