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",