Add some protection code.

CID:		1331893
MFC after:	3 days
This commit is contained in:
Michael Tuexen 2016-02-18 21:21:45 +00:00
parent 6df7c000d3
commit fdc4c9d067
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295772

View File

@ -365,8 +365,10 @@ sctp_process_init(struct sctp_init_chunk *cp, struct sctp_tcb *stcb)
}
SCTP_TCB_SEND_UNLOCK(stcb);
asoc->streamoutcnt = asoc->pre_open_streams;
for (i = 0; i < asoc->streamoutcnt; i++) {
asoc->strmout[i].state = SCTP_STREAM_OPEN;
if (asoc->strmout) {
for (i = 0; i < asoc->streamoutcnt; i++) {
asoc->strmout[i].state = SCTP_STREAM_OPEN;
}
}
/* EY - nr_sack: initialize highest tsn in nr_mapping_array */
asoc->highest_tsn_inside_nr_map = asoc->highest_tsn_inside_map;