]> granicus.if.org Git - openssl/commitdiff
Remove unnecessary check.
authorDr. Stephen Henson <steve@openssl.org>
Wed, 21 Sep 2016 11:57:01 +0000 (12:57 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 21 Sep 2016 18:56:05 +0000 (19:56 +0100)
The overflow check will never be triggered because the
the n2l3 result is always less than 2^24.

Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/s3_both.c

index 4b636b0e9b4789d15e83a9b3e462b507828eca8b..d53275fcf988a9d5d9c8858e7255fccf03b19b68 100644 (file)
@@ -415,11 +415,6 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok)
             SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_EXCESSIVE_MESSAGE_SIZE);
             goto f_err;
         }
-        if (l > (INT_MAX - 4)) { /* BUF_MEM_grow takes an 'int' parameter */
-            al = SSL_AD_ILLEGAL_PARAMETER;
-            SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_EXCESSIVE_MESSAGE_SIZE);
-            goto f_err;
-        }
         if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l + 4)) {
             SSLerr(SSL_F_SSL3_GET_MESSAGE, ERR_R_BUF_LIB);
             goto err;