summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-10-09 15:35:28 +0000
committermelifaro <melifaro@FreeBSD.org>2014-10-09 15:35:28 +0000
commitd23efba7dd470e247cbcacf9ec6cf642d02d5b8c (patch)
tree6d2822f6a5ff6c5c487b859a557d076b53b03c46 /sys/netinet/sctp_output.c
parentcab1d703b61e2216f130c6d1a23ca70b2b322386 (diff)
parentc47600c4ec062b8225ac1d48197a2a1de778760d (diff)
downloadFreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.zip
FreeBSD-src-d23efba7dd470e247cbcacf9ec6cf642d02d5b8c.tar.gz
Sync to HEAD@r272825.
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 8260ba7..7cbb30f 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -11846,7 +11846,7 @@ sctp_add_an_in_stream(struct sctp_tmit_chunk *chk,
int
sctp_send_str_reset_req(struct sctp_tcb *stcb,
- int number_entries, uint16_t * list,
+ uint16_t number_entries, uint16_t * list,
uint8_t send_out_req,
uint8_t send_in_req,
uint8_t send_tsn_req,
@@ -11879,6 +11879,14 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, EINVAL);
return (EINVAL);
}
+ if (number_entries > (MCLBYTES -
+ SCTP_MIN_OVERHEAD -
+ sizeof(struct sctp_chunkhdr) -
+ sizeof(struct sctp_stream_reset_out_request)) /
+ sizeof(uint16_t)) {
+ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM);
+ return (ENOMEM);
+ }
sctp_alloc_a_chunk(stcb, chk);
if (chk == NULL) {
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM);
OpenPOWER on IntegriCloud