[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 12 21:12:49 UTC 2019


 sc/source/ui/dataprovider/htmldataprovider.cxx |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit 07e1ad042f2dacff441129b1adbb1ed58dd6b16e
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Tue Sep 10 21:16:43 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Sep 12 23:12:06 2019 +0200

    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 at yahoo.fr>
    (cherry picked from commit ec57f6eca37192ada29cda1d37ec192472c0d9ef)
    Reviewed-on: https://gerrit.libreoffice.org/78813
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx b/sc/source/ui/dataprovider/htmldataprovider.cxx
index d82fc76700f5..6f7328bab06c 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)
         return;
 


More information about the Libreoffice-commits mailing list