[Libreoffice-commits] core.git: xmlsecurity/source

Michael Stahl mstahl at redhat.com
Tue Feb 19 02:36:55 PST 2013


 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 9a49ff646bdd27fb1355847828794b0a9df40e1d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 19 11:33:28 2013 +0100

    nsscrypto_initializer: MSVC does not support C99 dynamic arrays
    
    Change-Id: I407b2308756b46fbf0920881fc20972b486819b7

diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index 988d362..f9bc487 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -62,6 +62,8 @@
 #include "digestcontext.hxx"
 #include "ciphercontext.hxx"
 
+#include <boost/scoped_array.hpp>
+
 #include <nspr.h>
 #include <cert.h>
 #include <nss.h>
@@ -282,9 +284,9 @@ bool nsscrypto_initialize( const css::uno::Reference< css::uno::XComponentContex
             int errlen = PR_GetErrorTextLength();
             if(errlen > 0)
             {
-                char error[errlen + 1];
-                PR_GetErrorText(error);
-                xmlsec_trace("%s",error);
+                boost::scoped_array<char> const error(new char[errlen + 1]);
+                PR_GetErrorText(error.get());
+                xmlsec_trace("%s", error.get());
             }
             bSuccess = false;
         }
@@ -299,9 +301,9 @@ bool nsscrypto_initialize( const css::uno::Reference< css::uno::XComponentContex
             int errlen = PR_GetErrorTextLength();
             if(errlen > 0)
             {
-                char error[errlen + 1];
-                PR_GetErrorText(error);
-                xmlsec_trace("%s",error);
+                boost::scoped_array<char> const error(new char[errlen + 1]);
+                PR_GetErrorText(error.get());
+                xmlsec_trace("%s", error.get());
             }
             return false ;
         }


More information about the Libreoffice-commits mailing list