basic/source/runtime/methods.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit f2a98e85948451a9540831e0090422f08b945560 Author: Arnaud VERSINI <arnaud.vers...@libreoffice.org> AuthorDate: Sun Jul 24 20:07:25 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Sep 5 15:59:06 2022 +0200 BASIC : missing parameter check in SbRtl_CreateObject Change-Id: I44e8c17274e20eb080494b2eaf25f74d33a35b36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137394 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index c2f979f2cb8f..3b718d78a9af 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -182,6 +182,9 @@ static uno::Reference< ucb::XSimpleFileAccess3 > const & getFileAccess() void SbRtl_CreateObject(StarBASIC * pBasic, SbxArray & rPar, bool) { + if( rPar.Count() < 2 ) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + OUString aClass(rPar.Get(1)->GetOUString()); SbxObjectRef p = SbxBase::CreateObject( aClass ); if( !p.is() )