basic/source/runtime/methods.cxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
New commits: commit 8e48c41a218b33eafa383429995a840d08523fa1 Author: Alin Andrei Abahnencei <alinandrei2...@gmail.com> AuthorDate: Mon Dec 23 10:50:45 2024 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Jan 9 13:20:06 2025 +0100 tdf#154285 Check upper bound of arguments in SbRtl_Second function Signed-off-by: Alin Andrei Abahnencei <alinandrei2...@gmail.com> Change-Id: Ib3a97f9acb7778c90aa1c172ca82cf450a1e792f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179249 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 899a79cd90d5..f39b45f9bc37 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2085,16 +2085,11 @@ sal_Int32 implGetNanoSecond(double dDate) void SbRtl_Second(StarBASIC *, SbxArray & rPar, bool) { - if (rPar.Count() < 2) - { - StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - } - else - { - double nArg = rPar.Get(1)->GetDate(); - sal_Int16 nSecond = implGetSecond( nArg ); - rPar.Get(0)->PutInteger(nSecond); - } + if (rPar.Count() != 2) + return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + double nArg = rPar.Get(1)->GetDate(); + sal_Int16 nSecond = implGetSecond( nArg ); + rPar.Get(0)->PutInteger(nSecond); } double Now_Impl()