summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-03-29 18:17:38 +1000
committerPauli <paul.dale@oracle.com>2019-03-29 20:52:00 +1000
commit64a45882c70e29a725c57894e7f80a6161f457bc (patch)
treeba25efb4a2d258516c2c103898424e97fcde8c28 /engines
parentc75f80a468468b84843a6bc3f16ce84111e345ad (diff)
Ensure that the struct msghdr is properly zeroed.
This is probably harmless but best to properly initialise things. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8611)
Diffstat (limited to 'engines')
-rw-r--r--engines/e_afalg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/e_afalg.c b/engines/e_afalg.c
index 19d98d897b..c3f622e752 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -412,7 +412,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in,
size_t inl, const unsigned char *iv,
unsigned int enc)
{
- struct msghdr msg = { 0 };
+ struct msghdr msg;
struct cmsghdr *cmsg;
struct iovec iov;
ssize_t sbytes;
@@ -421,6 +421,7 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in,
# endif
char cbuf[CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) + CMSG_SPACE(ALG_OP_LEN)];
+ memset(&msg, 0, sizeof(msg));
memset(cbuf, 0, sizeof(cbuf));
msg.msg_control = cbuf;
msg.msg_controllen = sizeof(cbuf);