diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-14 08:59:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-07-14 13:52:37 +0200 |
commit | 538d3e8d7ff08ea9287c4808b71ef4362cc54b98 (patch) | |
tree | 4aef5b63850c27e0beee90a1bd6683016b8664ef /sc/source/ui/vba | |
parent | 64140e0e7f8a151f298568c9173364efca636a46 (diff) |
fix ubsan
after
commit e40f69419e86fb9d189032410686c5c06efbdbbb
Author: Noel Grandin <noelgrandin@gmail.com>
Date: Mon Jul 10 18:33:52 2023 +0200
use more frozen
=================================================================
==27441==ERROR: AddressSanitizer: global-buffer-overflow on address
0x7feaccd42aa8 at pc 0x7feacc86a5e7 bp 0x7ffc3e6e9390 sp 0x7ffc3e6e9388
READ of size 4 at 0x7feaccd42aa8 thread T0
/sc/source/ui/vba/vbainterior.cxx:103:58
ScVbaInterior::setColor(com::sun::star::uno::Any const&)
/sc/source/ui/vba/vbainterior.cxx:90:9
ScVbaInterior::setColorIndex(com::sun::star::uno::Any const&)
/sc/source/ui/vba/vbainterior.cxx:150:9
Change-Id: Iee3667ae975caffdeb63149738daea5c1b8ae01f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154432
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/vba')
-rw-r--r-- | sc/source/ui/vba/vbainterior.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index 8172d4096407..2de1abb73654 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -100,7 +100,10 @@ ScVbaInterior::SetMixedColor() { m_nPattern = GetAttributeData( aPattern ); } - sal_Int32 nPattern = aPatternMap.find( m_nPattern )->second; + sal_Int32 nPattern = 0; + auto it = aPatternMap.find( m_nPattern ); + if (it != aPatternMap.end()) + nPattern = it->second; // pattern color uno::Any aPatternColor = GetUserDefinedAttributes( PATTERNCOLOR ); if( aPatternColor.hasValue() ) |