basic/source/runtime/methods.cxx |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 022e95d39d9ae29496be0f81740eefaf515f578a
Author:     Alin Andrei Abahnencei <alinandrei2...@gmail.com>
AuthorDate: Mon Dec 23 10:55:14 2024 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Jan 5 16:00:08 2025 +0100

    tdf#154285 Check upper bound of arguments in SbRtl_Minute function
    
    Signed-off-by: Alin Andrei Abahnencei <alinandrei2...@gmail.com>
    Change-Id: Ic861d453395a10d484614e29b5a491800ddb7a25
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179251
    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 3c4af82d4184..2ce6361c8d8b 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2066,16 +2066,11 @@ void SbRtl_Hour(StarBASIC *, SbxArray & rPar, bool)
 
 void SbRtl_Minute(StarBASIC *, SbxArray & rPar, bool)
 {
-    if (rPar.Count() < 2)
-    {
-        StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
-    }
-    else
-    {
-        double nArg = rPar.Get(1)->GetDate();
-        sal_Int16 nMin = implGetMinute( nArg );
-        rPar.Get(0)->PutInteger(nMin);
-    }
+    if (rPar.Count() != 2)
+        return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
+    double nArg = rPar.Get(1)->GetDate();
+    sal_Int16 nMin = implGetMinute( nArg );
+    rPar.Get(0)->PutInteger(nMin);
 }
 
 void SbRtl_Month(StarBASIC *, SbxArray & rPar, bool)

Reply via email to