scaddins/source/analysis/analysis.cxx | 2 +- scaddins/source/datefunc/datefunc.cxx | 2 +- scaddins/source/pricing/pricing.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit dac843c4dc0407430d5a7441fd80940a99a4d8f8 Author: Eike Rathke <er...@redhat.com> AuthorDate: Tue Aug 2 19:09:03 2022 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Tue Aug 2 20:22:47 2022 +0200 Use nNumOfLoc instead of sizeof(pLang) ... which is count*sizeof(char*), but luckily this private function was never used with out-of-bounds values. Change-Id: Ief3b3de614ca0df00c424f7caabf70e029ea7266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137703 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 9ad63bc15efa..9c9fc9718c59 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -298,7 +298,7 @@ inline const lang::Locale& AnalysisAddIn::GetLocale( sal_uInt32 nInd ) if( !pDefLocales ) InitDefLocales(); - if( nInd < sizeof( pLang ) ) + if( nInd < nNumOfLoc ) return pDefLocales[ nInd ]; else return aFuncLoc; diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index 3ca23c5f0571..92492b29d150 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -120,7 +120,7 @@ const lang::Locale& ScaDateAddIn::GetLocale( sal_uInt32 nIndex ) if( !pDefLocales ) InitDefLocales(); - return (nIndex < sizeof( pLang )) ? pDefLocales[ nIndex ] : aFuncLoc; + return (nIndex < nNumOfLoc) ? pDefLocales[ nIndex ] : aFuncLoc; } void ScaDateAddIn::InitData() diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 3961603bc04b..8652defb3ac0 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -125,7 +125,7 @@ const lang::Locale& ScaPricingAddIn::GetLocale( sal_uInt32 nIndex ) if( !pDefLocales ) InitDefLocales(); - return (nIndex < sizeof( pLang )) ? pDefLocales[ nIndex ] : aFuncLoc; + return (nIndex < nNumOfLoc) ? pDefLocales[ nIndex ] : aFuncLoc; } void ScaPricingAddIn::InitData()