diff options
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 1e7c9c39d06e..988d362a6c7b 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 ; } } |