xmloff/source/style/xmlbahdl.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit 49c9b3723056addb0a443eaee71c8aacbdda4dc6 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Jul 15 13:54:18 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Jul 15 17:38:17 2019 +0200 ofz#15797 Integer-overflow Change-Id: I623c934f5bb031d383dcf1ce779521a942f99bdf Reviewed-on: https://gerrit.libreoffice.org/75634 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/xmloff/source/style/xmlbahdl.cxx b/xmloff/source/style/xmlbahdl.cxx index 488a5873f83b..695d78f087f6 100644 --- a/xmloff/source/style/xmlbahdl.cxx +++ b/xmloff/source/style/xmlbahdl.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <o3tl/any.hxx> +#include <o3tl/safeint.hxx> #include <sax/tools/converter.hxx> #include <xmloff/xmluconv.hxx> #include <com/sun/star/uno/Any.hxx> @@ -377,9 +378,11 @@ XMLNegPercentPropHdl::~XMLNegPercentPropHdl() bool XMLNegPercentPropHdl::importXML( const OUString& rStrImpValue, Any& rValue, const SvXMLUnitConverter& ) const { sal_Int32 nValue = 0; - bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); - lcl_xmloff_setAny( rValue, 100-nValue, nBytes ); - + bool bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue ); + if (bRet) + bRet = !o3tl::checked_sub<sal_Int32>(100, nValue, nValue); + if (bRet) + lcl_xmloff_setAny( rValue, nValue, nBytes ); return bRet; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits