Bug 1368980 - Fix an assertion that was comparing an unsigned >= 0 unhelpfully. r=mt NSS_TLS13_DRAFT19_BRANCH
authorPatrick McManus <mcmanus@ducksong.com>
Mon, 21 Aug 2017 09:33:18 +1000
branchNSS_TLS13_DRAFT19_BRANCH
changeset 13535 f07c161ac5c8a01dfb22160970762150ad93fe18
parent 13532 0f34fb88edaab713e44977f5c33ff69a742c8da2
child 13545 32a679e3f6ba53f68b0287a5dea66a8d46436923
push id2328
push usermartin.thomson@gmail.com
push dateSun, 20 Aug 2017 23:36:10 +0000
reviewersmt
bugs1368980
Bug 1368980 - Fix an assertion that was comparing an unsigned >= 0 unhelpfully. r=mt Differential Revision: https://nss-review.dev.mozaws.net/D415
lib/ssl/tls13con.c
--- a/lib/ssl/tls13con.c
+++ b/lib/ssl/tls13con.c
@@ -3650,17 +3650,17 @@ SECStatus
 tls13_WriteExtensionsWithBinder(sslSocket *ss, sslBuffer *extensions)
 {
     SSL3Hashes hashes;
     SECStatus rv;
     unsigned int size = tls13_GetHashSize(ss);
     unsigned int prefixLen = extensions->len - size - 3;
     unsigned int finishedLen;
 
-    PORT_Assert(extensions->len - size - 3 >= 0);
+    PORT_Assert(extensions->len >= size + 3);
 
     rv = ssl3_AppendHandshakeNumber(ss, extensions->len, 2);
     if (rv != SECSuccess) {
         return SECFailure;
     }
 
     /* Only write the extension up to the point before the binders.  Assume that
      * the pre_shared_key extension is at the end of the buffer.  Don't write