Kaydet (Commit) 4b313d80 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1371452 Wrapper object use after free

have another stab at silencing that

Change-Id: Ia3fe1c072bd8062a13991bbb2eca008264450138
üst 782dffe7
......@@ -298,7 +298,7 @@ namespace XSLT
if (styleSheet)
{
m_tcontext = xsltNewTransformContext(styleSheet, doc);
m_tcontext->_private = static_cast<void *> (oh.get());
oh->registercontext(m_tcontext);
xsltQuoteUserParams(m_tcontext, &params[0]);
result = xsltApplyStylesheetUser(styleSheet, doc, nullptr, nullptr, nullptr,
m_tcontext);
......
......@@ -57,16 +57,30 @@ namespace XSLT
class OleHandler
{
public:
OleHandler(const css::uno::Reference<XComponentContext>& rxContext){
m_xContext = rxContext;
OleHandler(const css::uno::Reference<XComponentContext>& rxContext)
: m_xContext(rxContext)
, m_tcontext(nullptr)
{
}
~OleHandler()
{
if (m_tcontext)
m_tcontext->_private = nullptr;
}
void SAL_CALL insertByName(const OUString& streamName, const OString& content);
const OString SAL_CALL getByName(const OUString& streamName);
void registercontext(xsltTransformContextPtr context)
{
assert(context);
m_tcontext = context;
m_tcontext->_private = this;
}
private:
css::uno::Reference<XComponentContext> m_xContext;
css::uno::Reference<XNameContainer> m_storage;
css::uno::Reference<XStream> m_rootStream;
xsltTransformContextPtr m_tcontext;
void SAL_CALL ensureCreateRootStorage();
OString SAL_CALL encodeSubStorage(const OUString& streamName);
......@@ -76,5 +90,6 @@ namespace XSLT
};
}
#endif // INCLUDED_FILTER_SOURCE_XSLTFILTER_OLEHANDLER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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