Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Aug 2020 23:11:54 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364589 - stable/12/sys/netinet
Message-ID:  <202008232311.07NNBsK3030062@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun Aug 23 23:11:53 2020
New Revision: 364589
URL: https://svnweb.freebsd.org/changeset/base/364589

Log:
  MFC r361222:
  Avoid an integer underflow.

Modified:
  stable/12/sys/netinet/sctp_asconf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_asconf.c
==============================================================================
--- stable/12/sys/netinet/sctp_asconf.c	Sun Aug 23 23:10:25 2020	(r364588)
+++ stable/12/sys/netinet/sctp_asconf.c	Sun Aug 23 23:11:53 2020	(r364589)
@@ -1803,9 +1803,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008232311.07NNBsK3030062>