[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - xmlsecurity/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 5 12:10:07 UTC 2018


 xmlsecurity/source/xmlsec/xmlstreamio.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9518a9af852f069a268badbc691abb4c09a37be8
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Dec 4 17:48:47 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 5 13:09:44 2018 +0100

    tdf#118373 xmlsecurity: avoid stderr output on libxmlsec version check
    
    Make sure that our normal SAL_WARN() reporting is registered during the
    xmlSecCheckVersionExt() invocation, just like it's registered during
    other libxmlsec API calls.
    
    (cherry picked from commit 099ab643f60efc5be6f151bff89651efd2da1fc9)
    
    Change-Id: Ia19368b55dbae47974f48954f86b50e36d1462ff
    Reviewed-on: https://gerrit.libreoffice.org/64605
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
index be48ae34b232..5b1b0212073c 100644
--- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx
@@ -22,8 +22,10 @@
  * Implementation of the I/O interfaces based on stream and URI binding
  */
 #include <xmlsec/xmlstreamio.hxx>
+#include <xmlsec/errorcallback.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/uri.hxx>
+#include <comphelper/scopeguard.hxx>
 
 #include <libxml/uri.h>
 #include <xmlsec-wrapper.h>
@@ -151,6 +153,10 @@ XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks()
         //Notes: all none default callbacks will lose.
         xmlSecIOCleanupCallbacks() ;
 
+        // Make sure that errors are reported via SAL_WARN().
+        setErrorRecorder();
+        comphelper::ScopeGuard g([] { clearErrorRecorder(); });
+
         // Newer xmlsec wants the callback order in the opposite direction.
         if (xmlSecCheckVersionExt(1, 2, 26, xmlSecCheckVersionABICompatible))
         {


More information about the Libreoffice-commits mailing list