diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-02-18 03:37:35 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-02-22 07:48:32 +0000 |
commit | 50ba5ad06a6ceca436f0bce35019ea4f25f8aed0 (patch) | |
tree | 0128efbb8ecfd1e318048fb5354c3b61eb18938e /xmlsecurity | |
parent | 21f13f91f905d606687f113c4c0c90c6aa6c1196 (diff) |
coverity#982249 Unchecked return value
Change-Id: I959599c899b489aa42ccce60c6794869041522a0
Reviewed-on: https://gerrit.libreoffice.org/2222
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index c78aec7737cd..5234d80e3601 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -335,22 +335,22 @@ const Sequence< sal_Int8>& X509Certificate_NssImpl :: getUnoTunnelId() { { if( pCert != NULL ) { + SECStatus rv; unsigned char fingerprint[20]; int length = ((id == SEC_OID_MD5)?MD5_LENGTH:SHA1_LENGTH); memset(fingerprint, 0, sizeof fingerprint); - PK11_HashBuf(id, fingerprint, pCert->derCert.data, pCert->derCert.len); - - Sequence< sal_Int8 > thumbprint( length ) ; - for( int i = 0 ; i < length ; i ++ ) - thumbprint[i] = fingerprint[i]; + rv = PK11_HashBuf(id, fingerprint, pCert->derCert.data, pCert->derCert.len); + if(rv == SECSuccess) + { + Sequence< sal_Int8 > thumbprint( length ) ; + for( int i = 0 ; i < length ; i ++ ) + thumbprint[i] = fingerprint[i]; - return thumbprint; - } - else - { - return ::com::sun::star::uno::Sequence< sal_Int8 >(); + return thumbprint; + } } + return ::com::sun::star::uno::Sequence< sal_Int8 >(); } ::rtl::OUString SAL_CALL X509Certificate_NssImpl::getSubjectPublicKeyAlgorithm() |