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 19:00:46 +0000 (20:00 +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>
(cherry picked from commit 709ec8b3848e2ac201b86f49c5561debb8572ccd)

ssl/s3_both.c

index c51fc6ea016a3aa30a043cf436fbe16f3dfe31e4..498e3975f53738ebf51ba41876cdb0d327dea1f5 100644 (file)
@@ -497,11 +497,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;