summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-21 16:07:46 +0000
committerEike Rathke <erack@redhat.com>2017-01-23 22:00:00 +0000
commitf7e79ee29b290503f2fd866fbd8064e30e8fec73 (patch)
treee85fc9c4c97bf55e6b0c210b506787c7589c86dc /sc
parentd3b250cffeba171ca1b1f793d188b1d05f57e66b (diff)
coverity#1399031 golden, Out-of-bounds read
There are 17 elements, so SAL_N_ELEMENTS(sppnPatterns) is 17 The largest valid index is 16, not 17, so valid max index is out by one Change-Id: Id20218a0e73cb9e502a631fa6bfbb3f0a22c4727 (cherry picked from commit 9ad08b403be9c6646cda9a379332545c3668975b) Reviewed-on: https://gerrit.libreoffice.org/33400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xiescher.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 9a1484d0ac55..0506ed482bce 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -701,7 +701,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillDa
{ 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
{ 0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00 }
};
- const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, SAL_N_ELEMENTS( sppnPatterns ) ) ];
+ const sal_uInt8* const pnPattern = sppnPatterns[std::min<size_t>(rFillData.mnPattern - 2, SAL_N_ELEMENTS(sppnPatterns) - 1)];
// create 2-colored 8x8 DIB
SvMemoryStream aMemStrm;
aMemStrm.WriteUInt32( 12 ).WriteInt16( 8 ).WriteInt16( 8 ).WriteUInt16( 1 ).WriteUInt16( 1 );