xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
New commits: commit 21e2c2f16408328f78f418dd9dc086ef2a2a8f19 Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Mon Feb 18 04:25:05 2013 -0600 coverity#982590 Explicit null dereferenced Change-Id: Ie898603f64a4568a8502caf3db154ae5ce008af9 Reviewed-on: https://gerrit.libreoffice.org/2227 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 1e7c9c3..988d362 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -279,11 +279,13 @@ bool nsscrypto_initialize( const css::uno::Reference< css::uno::XComponentContex if( NSS_InitReadWrite( sCertDir.getStr() ) != SECSuccess ) { xmlsec_trace("Initializing NSS with profile failed."); - char * error = NULL; - - PR_GetErrorText(error); - if (error) + int errlen = PR_GetErrorTextLength(); + if(errlen > 0) + { + char error[errlen + 1]; + PR_GetErrorText(error); xmlsec_trace("%s",error); + } bSuccess = false; } } @@ -294,10 +296,13 @@ bool nsscrypto_initialize( const css::uno::Reference< css::uno::XComponentContex if ( NSS_NoDB_Init(NULL) != SECSuccess ) { xmlsec_trace("Initializing NSS without profile failed."); - char * error = NULL; - PR_GetErrorText(error); - if (error) + int errlen = PR_GetErrorTextLength(); + if(errlen > 0) + { + char error[errlen + 1]; + PR_GetErrorText(error); xmlsec_trace("%s",error); + } return false ; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits