summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-08-28 10:53:42 +0100
committerMichael Stahl <mstahl@redhat.com>2017-08-28 14:58:30 +0200
commitb72dee386ac15a7fd6098503772e606c5f059a20 (patch)
tree0439c964236f7266dd2a9844332433b8dc2d1e2f
parent35c07f69a28c24a8561f86ff82387f11a85d368a (diff)
ofz#3121 check bounds better
Change-Id: Ib1eacda7e4cdf1d0238532f4e38059a9c30556ac Reviewed-on: https://gerrit.libreoffice.org/41628 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--filter/source/graphicfilter/icgm/class4.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx
index ff574c4eece4..e97781d314e7 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -186,7 +186,7 @@ void CGM::ImplDoClass4()
sal_uInt32 nType = ImplGetUI16( 4 );
sal_uInt32 nSize = ImplGetUI( 1 );
- if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
+ if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
mpSource[mnParaSize + nSize] = 0;
@@ -224,7 +224,7 @@ void CGM::ImplDoClass4()
sal_uInt32 nType = ImplGetUI16(4);
sal_uInt32 nSize = ImplGetUI(1);
- if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
+ if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
mpSource[ mnParaSize + nSize ] = 0;
@@ -242,7 +242,7 @@ void CGM::ImplDoClass4()
sal_uInt32 nType = ImplGetUI16( 4 );
sal_uInt32 nSize = ImplGetUI( 1 );
- if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
+ if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
mpSource[ mnParaSize + nSize ] = 0;