fix build error in 32 bit debug build
authorcedral <joseph@southwell.org>
Wed, 4 Apr 2018 17:12:23 +0000 (19:12 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 4 Apr 2018 17:12:23 +0000 (19:12 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5861)

ssl/t1_trce.c

index e5b4085c2051d029e946a4157de404c423626691..3df3f54c8525d0d40fdf8ca0f8e6a6052f792b2f 100644 (file)
@@ -1278,11 +1278,12 @@ void SSL_trace(int write_p, int version, int content_type,
             int hvers;
 
             /* avoid overlapping with length at the end of buffer */
-            if (msglen < (SSL_IS_DTLS(ssl) ? 13 : 5)) {
-                    BIO_puts(bio, write_p ? "Sent" : "Received");
-                    ssl_print_hex(bio, 0, " too short message", msg, msglen);
-                    break;
-                }
+            if (msglen < (size_t)(SSL_IS_DTLS(ssl) ?
+                         DTLS1_RT_HEADER_LENGTH : SSL3_RT_HEADER_LENGTH)) {
+                BIO_puts(bio, write_p ? "Sent" : "Received");
+                ssl_print_hex(bio, 0, " too short message", msg, msglen);
+                break;
+            }
             hvers = msg[1] << 8 | msg[2];
             BIO_puts(bio, write_p ? "Sent" : "Received");
             BIO_printf(bio, " Record\nHeader:\n  Version = %s (0x%x)\n",