sctp: add missing check
If memory allocation fails, m is NULL. Since this is possible, check for it. Reported by: Coverity Scan CID: 1086866 MFC after: 3 days
This commit is contained in:
@@ -6705,8 +6705,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr,
|
|||||||
} else {
|
} else {
|
||||||
m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
|
m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr),
|
||||||
0, M_NOWAIT, 1, MT_DATA);
|
0, M_NOWAIT, 1, MT_DATA);
|
||||||
|
if (m != NULL) {
|
||||||
SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
|
SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (m != NULL) {
|
if (m != NULL) {
|
||||||
struct sctp_paramhdr *ph;
|
struct sctp_paramhdr *ph;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user