svn commit: r361222 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Mon May 18 18:32:59 UTC 2020


Author: tuexen
Date: Mon May 18 18:32:58 2020
New Revision: 361222
URL: https://svnweb.freebsd.org/changeset/base/361222

Log:
  Avoid an integer underflow.
  
  MFC after:		3 days

Modified:
  head/sys/netinet/sctp_asconf.c

Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c	Mon May 18 18:27:10 2020	(r361221)
+++ head/sys/netinet/sctp_asconf.c	Mon May 18 18:32:58 2020	(r361222)
@@ -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);


More information about the svn-src-head mailing list