Avoid an integer underflow.

MFC after:		3 days
This commit is contained in:
Michael Tuexen 2020-05-18 18:32:58 +00:00
parent 60017c8e88
commit 6395219ae3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361222

View File

@ -1797,9 +1797,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset,
} /* switch */
/* update remaining ASCONF-ACK message length to process */
ack_length -= SCTP_SIZE32(param_length);
if (ack_length <= 0) {
/* no more data in the mbuf chain */
if (ack_length > SCTP_SIZE32(param_length)) {
ack_length -= SCTP_SIZE32(param_length);
} else {
break;
}
offset += SCTP_SIZE32(param_length);