summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-06-26 21:57:03 +0200
committerAndras Timar <andras.timar@collabora.com>2013-11-05 11:16:47 +0100
commite235509de52a913d10bcf0b7edb67f4ed57efbc9 (patch)
treead55afdc4f8273bfbacc9b4b2bac2edb52c5f521 /unoxml
parent3c4802a7ddec38d5465bed1d589b87b03bdd5ba9 (diff)
fdo#64672 prevent raptor from setting global libxml2 error handlers
Raptor already sets up all 4 error handlers in xmlSAXHandler so why it would need the global ones in addition to that is a mystery anyway. Messing with libxml2's globals can only cause trouble. Change-Id: I2935efe5c4cd75d48cc4ecdeaa8437e91b48349e (cherry picked from commit 246a78b1d2a88ff1937b09b22325d160739ef47e) Reviewed-on: https://gerrit.libreoffice.org/4554 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/rdf/librdf_repository.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx
index 733b3132e0c4..760049d4f3fd 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -1903,6 +1903,18 @@ librdf_Repository::getStatementsGraph(
return new librdf_GraphResult(this, m_aMutex, pStream, pContext);
}
+#ifdef RAPTOR_V2_AVAILABLE
+extern "C"
+void librdf_raptor_init(void* /*user_data*/, raptor_world* pRaptorWorld)
+{
+ // fdo#64672 prevent raptor from setting global libxml2 error handlers
+ raptor_world_set_flag(pRaptorWorld,
+ RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE, 0);
+ raptor_world_set_flag(pRaptorWorld,
+ RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE, 0);
+}
+#endif
+
librdf_world *librdf_TypeConverter::createWorld() const
{
// create and initialize world
@@ -1912,6 +1924,10 @@ librdf_world *librdf_TypeConverter::createWorld() const
"librdf_TypeConverter::createWorld: librdf_new_world failed",
m_rRep);
}
+#ifdef RAPTOR_V2_AVAILABLE
+ // note for the bundled raptor V1 a patch is applied instead
+ librdf_world_set_raptor_init_handler(pWorld, 0, &librdf_raptor_init);
+#endif
//FIXME logger, digest, features?
xsltSecurityPrefsPtr origprefs = xsltGetDefaultSecurityPrefs();
librdf_world_open(pWorld);