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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user