[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 17 10:34:06 UTC 2018


 sc/source/filter/xml/xmlfilti.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 18d9fb3c4ce3829c73a8f1007887c3176d43b06f
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jul 17 08:30:59 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 17 12:33:45 2018 +0200

    ofz#9454 Integer-overflow
    
    Change-Id: I6eecf45110d84951a892b4387a6a554aff198810
    Reviewed-on: https://gerrit.libreoffice.org/57544
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx
index b51929eec871..45027f625ae4 100644
--- a/sc/source/filter/xml/xmlfilti.cxx
+++ b/sc/source/filter/xml/xmlfilti.cxx
@@ -26,6 +26,7 @@
 #include <queryentry.hxx>
 #include <document.hxx>
 
+#include <o3tl/safeint.hxx>
 #include <svl/sharedstringpool.hxx>
 #include <xmloff/xmltkmap.hxx>
 #include <xmloff/nmspmap.hxx>
@@ -429,7 +430,7 @@ void SAL_CALL ScXMLConditionContext::endFastElement( sal_Int32 /*nElement*/ )
 
     GetOperator(sOperator, mrQueryParam, rEntry);
     SCCOLROW nStartPos = mrQueryParam.bByRow ? mrQueryParam.nCol1 : mrQueryParam.nRow1;
-    rEntry.nField = nField + nStartPos;
+    rEntry.nField = o3tl::saturating_add(nField, nStartPos);
 
     if (maQueryItems.empty())
     {


More information about the Libreoffice-commits mailing list