From: Kevin Cadieux Date: Wed, 17 Mar 2021 03:23:38 +0000 (-0700) Subject: Fixing stack buffer overflow error caused by incorrectly sized array. X-Git-Tag: openssl-3.0.0-alpha14~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=628d2d3a7f2318b6a6a1c36f9d8d12032c69a9dd;p=thirdparty%2Fopenssl.git Fixing stack buffer overflow error caused by incorrectly sized array. CLA: trivial Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14582) --- diff --git a/test/params_api_test.c b/test/params_api_test.c index 38d6913ec58..c1dbdad1292 100644 --- a/test/params_api_test.c +++ b/test/params_api_test.c @@ -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);