diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-09-10 21:16:43 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2019-09-11 09:59:54 +0200 |
commit | ec57f6eca37192ada29cda1d37ec192472c0d9ef (patch) | |
tree | 71248134c866f105171b903b4c8160228b57d527 /sc/source | |
parent | 735af14843eab3e75ac9ed6f0773ce7bb3241c8a (diff) |
tdf#127461: fix data provider crashes
See bts provided in the bugtracker
Change-Id: I1cc38add93446f8372c80ca45962b04bfa627923
Reviewed-on: https://gerrit.libreoffice.org/78803
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/dataprovider/htmldataprovider.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx b/sc/source/ui/dataprovider/htmldataprovider.cxx index bbe6dd3c514b..b8b7b3746d2c 100644 --- a/sc/source/ui/dataprovider/htmldataprovider.cxx +++ b/sc/source/ui/dataprovider/htmldataprovider.cxx @@ -192,8 +192,21 @@ void HTMLFetchThread::execute() OString aID = OUStringToOString(maID, RTL_TEXTENCODING_UTF8); xmlXPathContextPtr pXmlXpathCtx = xmlXPathNewContext(pHtmlPtr); xmlXPathObjectPtr pXmlXpathObj = xmlXPathEvalExpression(BAD_CAST(aID.getStr()), pXmlXpathCtx); + + if (!pXmlXpathObj) + { + xmlXPathFreeContext(pXmlXpathCtx); + return; + } xmlNodeSetPtr pXmlNodes = pXmlXpathObj->nodesetval; + if (!pXmlNodes) + { + xmlXPathFreeNodeSetList(pXmlXpathObj); + xmlXPathFreeContext(pXmlXpathCtx); + return; + } + if (pXmlNodes->nodeNr == 0) { xmlXPathFreeNodeSet(pXmlNodes); |