Fixing stack buffer overflow error caused by incorrectly sized array.
authorKevin Cadieux <kevca@microsoft.com>
Wed, 17 Mar 2021 03:23:38 +0000 (20:23 -0700)
committerTomas Mraz <tomas@openssl.org>
Thu, 18 Mar 2021 09:56:28 +0000 (10:56 +0100)
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14582)

test/params_api_test.c

index 38d6913ec5862a0efd0d46c7b8d0d49183cb9db1..c1dbdad1292ff0974b13137c4437dabb500ae796 100644 (file)
@@ -390,8 +390,8 @@ static int test_param_size_t(int n)
 static int test_param_time_t(int n)
 {
     time_t in, out;
-    unsigned char buf[MAX_LEN], cmp[sizeof(size_t)];
-    const size_t len = raw_values[n].len >= sizeof(size_t)
+    unsigned char buf[MAX_LEN], cmp[sizeof(time_t)];
+    const size_t len = raw_values[n].len >= sizeof(time_t)
                        ? sizeof(time_t) : raw_values[n].len;
     OSSL_PARAM param = OSSL_PARAM_time_t("a", NULL);