summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Christ <jchrist@linux.ibm.com>2021-05-25 18:03:06 +0200
committerPauli <pauli@openssl.org>2021-05-27 12:31:13 +0200
commit4612eec35def0523192ee2c406f99ea5bbb184fb (patch)
tree2cb1cf00b69cdf3c0c07aae1acd388cea0c79273
parentcoverity 1484912: Null pointer dereferences (NULL_RETURNS) (diff)
downloadopenssl-4612eec35def0523192ee2c406f99ea5bbb184fb.tar.xz
openssl-4612eec35def0523192ee2c406f99ea5bbb184fb.zip
Fix compilation warning with GCC11.
Parameter "header" of ssl3_cbc_digest_record was fixed to a 13 bytes header but used as a pointer. This caused a warning about out-of-bounds array access with GCC 11. Fixes #15462. Signed-off-by: Juergen Christ <jchrist@linux.ibm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15463)
-rw-r--r--ssl/s3_cbc.c4
-rw-r--r--ssl/ssl_local.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/ssl/s3_cbc.c b/ssl/s3_cbc.c
index f5db247e92..8e1c779ddb 100644
--- a/ssl/s3_cbc.c
+++ b/ssl/s3_cbc.c
@@ -34,7 +34,7 @@ char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx);
int ssl3_cbc_digest_record(const EVP_MD *md,
unsigned char *md_out,
size_t *md_out_size,
- const unsigned char header[13],
+ const unsigned char *header,
const unsigned char *data,
size_t data_size,
size_t data_plus_mac_plus_padding_size,
@@ -156,7 +156,7 @@ static void tls1_sha512_final_raw(void *ctx, unsigned char *md_out)
int ssl3_cbc_digest_record(const EVP_MD *md,
unsigned char *md_out,
size_t *md_out_size,
- const unsigned char header[13],
+ const unsigned char *header,
const unsigned char *data,
size_t data_size,
size_t data_plus_mac_plus_padding_size,
diff --git a/ssl/ssl_local.h b/ssl/ssl_local.h
index 8f3a2f93d6..28603a81ad 100644
--- a/ssl/ssl_local.h
+++ b/ssl/ssl_local.h
@@ -2770,7 +2770,7 @@ __owur char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx);
__owur int ssl3_cbc_digest_record(const EVP_MD *md,
unsigned char *md_out,
size_t *md_out_size,
- const unsigned char header[13],
+ const unsigned char *header,
const unsigned char *data,
size_t data_size,
size_t data_plus_mac_plus_padding_size,