diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-05 15:01:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-11-05 21:00:37 +0100 |
commit | 5336952fc7fa6f8e1ae9652f59c87e29693694d4 (patch) | |
tree | 2555e8a0b44b63ad671ad2453e8262a7b3b5dd6a /xmlsecurity/source/xmlsec | |
parent | 1c216f5291e09ccca430551f5bc2677def3842cb (diff) |
cid#1516654 Unchecked return value
Change-Id: I19fcac7f1c4dff3bd18fe0cee0188e207edd4251
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142330
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity/source/xmlsec')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 97f2ce3b4ea7..3aa9cab78a51 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -475,8 +475,8 @@ Reference< XCertificate > SecurityEnvironment_NssImpl::createCertificateFromAsci OString oscert = OUStringToOString( asciiCertificate , RTL_TEXTENCODING_ASCII_US ) ; xmlChar* chCert = xmlStrndup( reinterpret_cast<const xmlChar*>(oscert.getStr()), static_cast<int>(oscert.getLength()) ) ; xmlSecSize certSize; - xmlSecBase64Decode_ex( chCert, reinterpret_cast<xmlSecByte*>(chCert), xmlStrlen( chCert ), &certSize ) ; - if (certSize == 0) + int nRet = xmlSecBase64Decode_ex( chCert, reinterpret_cast<xmlSecByte*>(chCert), xmlStrlen( chCert ), &certSize ) ; + if (nRet < 0 || certSize == 0) return nullptr; Sequence< sal_Int8 > rawCert(comphelper::arrayToSequence<sal_Int8>(chCert, certSize)) ; |