summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-21 16:07:46 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-21 17:05:43 +0000
commit9ad08b403be9c6646cda9a379332545c3668975b (patch)
tree693bc4008a5c3938a3be91c8acf904de817276fd /sc
parentcoverity#704601 Dereference after null check (diff)
downloadcore-9ad08b403be9c6646cda9a379332545c3668975b.tar.gz
core-9ad08b403be9c6646cda9a379332545c3668975b.zip
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
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 ab28bc7bdfc1..2d3221ab5702 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 );