Commit 45e45300 authored by Ralf Habacker's avatar Ralf Habacker Committed by Sebastian Trueg
Browse files

crash fix on windows

transform() is called recursive, which sets xsltprocExternalEntityLoader()
as default external entity handler. The default handler is called in
xsltprocExternalEntityLoader(), which calls itself until kioslave crashes
on stack overflow.

The bug is fixed by only setting the default handler on the first call.

CCBUG: 283858
parent e95f3be9
...@@ -136,10 +136,12 @@ QString transform( const QString &pat, const QString& tss, ...@@ -136,10 +136,12 @@ QString transform( const QString &pat, const QString& tss,
#if defined (SIMPLE_XSLT) && defined(Q_WS_WIN) #if defined (SIMPLE_XSLT) && defined(Q_WS_WIN)
// prepare use of local available dtd versions instead of fetching everytime from the internet // prepare use of local available dtd versions instead of fetching everytime from the internet
// this approach is url based // this approach is url based
defaultEntityLoader = xmlGetExternalEntityLoader(); if (!defaultEntityLoader) {
xmlSetExternalEntityLoader(xsltprocExternalEntityLoader); defaultEntityLoader = xmlGetExternalEntityLoader();
xmlSetExternalEntityLoader(xsltprocExternalEntityLoader);
replaceURLList[QLatin1String("http://www.oasis-open.org/docbook/xml/4.2")] = QString("file:///%1").arg(DOCBOOK_XML_CURRDTD);
replaceURLList[QLatin1String("http://www.oasis-open.org/docbook/xml/4.2")] = QString("file:///%1").arg(DOCBOOK_XML_CURRDTD);
}
#endif #endif
xsltStylesheetPtr style_sheet = xsltStylesheetPtr style_sheet =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment