Fixes integer underflow with SSL_trace support
authorPhilippe Antoine <p.antoine@catenacyber.fr>
Wed, 21 Mar 2018 07:27:34 +0000 (08:27 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 21 Mar 2018 17:33:20 +0000 (17:33 +0000)
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5706)

ssl/t1_trce.c

index 55f1824183fc135517a5de93114de922aa3de5c2..f8d0501aa59a9c2f55960e6bce92524b42e0ff5d 100644 (file)
@@ -729,7 +729,7 @@ static int ssl_print_extension(BIO *bio, int indent, int server,
         while (xlen > 0) {
             size_t plen = *ext++;
 
-            if (plen > xlen + 1)
+            if (plen + 1 > xlen)
                 return 0;
             BIO_indent(bio, indent + 2, 80);
             BIO_write(bio, ext, plen);