From: Philippe Antoine Date: Wed, 21 Mar 2018 07:27:34 +0000 (+0100) Subject: Fixes integer underflow with SSL_trace support X-Git-Tag: OpenSSL_1_1_1-pre4~82 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=63ff89ab71d38f03bb56603e4048a1dc143942b2;p=oweals%2Fopenssl.git Fixes integer underflow with SSL_trace support Reviewed-by: Andy Polyakov Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/5706) --- diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c index 55f1824183..f8d0501aa5 100644 --- a/ssl/t1_trce.c +++ b/ssl/t1_trce.c @@ -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);