diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-10-15 01:57:12 +0300 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-17 09:53:42 +0200 |
commit | d51db77c8d87f210785a8a8c6dd875f7bacddb3c (patch) | |
tree | fd1ab208d49e85371fc9bb321539ce137bdaf719 /svl/source/crypto/cryptosign.cxx | |
parent | c8eaadb5d70f42723517bb028f363e37726be256 (diff) |
Remove some memset calls
Replace them with default initialization or calloc
Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1
Reviewed-on: https://gerrit.libreoffice.org/80805
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svl/source/crypto/cryptosign.cxx')
-rw-r--r-- | svl/source/crypto/cryptosign.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx index 4f6d757183ef..5a3f0271c40d 100644 --- a/svl/source/crypto/cryptosign.cxx +++ b/svl/source/crypto/cryptosign.cxx @@ -1393,9 +1393,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) return false; } - CRYPT_SIGN_MESSAGE_PARA aPara; - - memset(&aPara, 0, sizeof(aPara)); + CRYPT_SIGN_MESSAGE_PARA aPara = {}; aPara.cbSize = sizeof(aPara); aPara.dwMsgEncodingType = PKCS_7_ASN_ENCODING | X509_ASN_ENCODING; aPara.pSigningCert = pCertContext; @@ -1423,9 +1421,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) } assert(!bFreeNeeded); - CMSG_SIGNER_ENCODE_INFO aSignerInfo; - - memset(&aSignerInfo, 0, sizeof(aSignerInfo)); + CMSG_SIGNER_ENCODE_INFO aSignerInfo = {}; aSignerInfo.cbSize = sizeof(aSignerInfo); aSignerInfo.pCertInfo = pCertContext->pCertInfo; aSignerInfo.hNCryptKey = hCryptKey; @@ -1455,8 +1451,7 @@ bool Signing::Sign(OStringBuffer& rCMSHexBuffer) aSignerInfo.cAuthAttr = 1; aSignerInfo.rgAuthAttr = &aCertificateAttribute; - CMSG_SIGNED_ENCODE_INFO aSignedInfo; - memset(&aSignedInfo, 0, sizeof(aSignedInfo)); + CMSG_SIGNED_ENCODE_INFO aSignedInfo = {}; aSignedInfo.cbSize = sizeof(aSignedInfo); aSignedInfo.cSigners = 1; aSignedInfo.rgSigners = &aSignerInfo; |