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

Caolán McNamara caolanm at redhat.com
Fri Jan 5 19:22:51 UTC 2018


 lotuswordpro/source/filter/lwpparastyle.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cef6271497ad3fe74820b36d6387351b15a16519
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 5 14:59:49 2018 +0000

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

diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx
index b51d24b22251..b0d19ecc8b06 100644
--- a/lotuswordpro/source/filter/lwpparastyle.cxx
+++ b/lotuswordpro/source/filter/lwpparastyle.cxx
@@ -68,6 +68,7 @@
 #include "lwpnumberingoverride.hxx"
 #include "lwptaboverride.hxx"
 #include "lwpbackgroundoverride.hxx"
+#include <o3tl/safeint.hxx>
 #include <xfilter/xfdefs.hxx>
 #include <xfilter/xfparastyle.hxx>
 #include <xfilter/xfborders.hxx>
@@ -455,7 +456,7 @@ void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpInden
             Amount += pParentIndent->GetMFirst();
         else if (relative == LwpIndentOverride::RELATIVE_REST)
             Amount += pParentIndent->GetMRest();
-        pTotalIndent->SetMAll(Amount + pTotalIndent->GetMAll());
+        pTotalIndent->SetMAll(o3tl::saturating_add(Amount, pTotalIndent->GetMAll()));
         pTotalIndent->SetMRight(pParentIndent->GetMRight()+ pTotalIndent->GetMRight());
 
         pParaStyle->SetIndent(pTotalIndent->GetFirst());


More information about the Libreoffice-commits mailing list