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:01:04 +0000
commit5e314dfb058990a78cd9e1b9045ac0f186de7003 (patch)
treeb4063ef05714b3fe37c9c21eb2bac5cfa2471494 /sc
parentbf7f3c0baabf0a8e74687ca192ff59c8f3d06207 (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/33401 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 27139cc307f0..1236eeacd639 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 );