[Libreoffice-commits] core.git: 2 commits - filter/source
Caolán McNamara
caolanm at redhat.com
Tue Oct 24 13:28:16 UTC 2017
filter/source/graphicfilter/idxf/dxfgrprd.cxx | 10 ++++------
filter/source/graphicfilter/ipbm/ipbm.cxx | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)
New commits:
commit 3a4eab26cd8d7fdd6ed5bb16107da40e11866041
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 24 10:20:52 2017 +0100
ofz#3742 Integer-overflow
Change-Id: Ibb8441df04643dd52111342e6d2c2659033838bb
Reviewed-on: https://gerrit.libreoffice.org/43741
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/filter/source/graphicfilter/idxf/dxfgrprd.cxx
index a6c02a408c7c..a7b4f5e58b83 100644
--- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx
+++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx
@@ -178,15 +178,13 @@ long DXFGroupReader::ReadI()
return 0;
}
- long res = 0, nv = 1;
+ OStringBuffer aNumber;
if (*p == '-') {
- nv=-1;
- p++;
+ aNumber.append(*p++);
}
while ((p != end) && *p >= '0' && *p <= '9') {
- res=res*10+static_cast<long>(*p-'0');
- p++;
+ aNumber.append(*p++);
}
while ((p != end) && (*p==0x20)) p++;
@@ -195,7 +193,7 @@ long DXFGroupReader::ReadI()
return 0;
}
- return res*nv;
+ return aNumber.toString().toInt32();
}
double DXFGroupReader::ReadF()
commit 0667441b71912534552c0abdf0032283aa31cae3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 24 10:29:08 2017 +0100
ofz#3741 Integer-overflow
Change-Id: I9d3743291c88ab52543077ac7e62dc3c5925bafd
Reviewed-on: https://gerrit.libreoffice.org/43744
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/graphicfilter/ipbm/ipbm.cxx b/filter/source/graphicfilter/ipbm/ipbm.cxx
index 855a25309ca1..8e8181ae526f 100644
--- a/filter/source/graphicfilter/ipbm/ipbm.cxx
+++ b/filter/source/graphicfilter/ipbm/ipbm.cxx
@@ -86,7 +86,7 @@ bool PBMReader::ReadPBM(Graphic & rGraphic )
case 0:
{
const size_t nRemainingSize = mrPBM.remainingSize();
- const size_t nDataRequired = mnWidth * (mnHeight / 8);
+ const size_t nDataRequired = static_cast<size_t>(mnWidth) * (mnHeight / 8);
if (nRemainingSize < nDataRequired)
return false;
More information about the Libreoffice-commits
mailing list