[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Thu Jun 9 12:48:16 UTC 2016


 sc/source/core/tool/interpr2.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 2c08ec226e771de10c8863b7f1cda016fea442d2
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jun 9 14:43:44 2016 +0200

    Resolves: tdf#100285 EASTERSUNDAY() check valid year between 1583 and 9956
    
    Change-Id: I4b25f1eb8e3cf0236b69607bb9ab9b4c57ae918a

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 1abe634..37594e2 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -288,6 +288,12 @@ void ScInterpreter::ScEasterSunday()
         nYear = (sal_Int16) ::rtl::math::approxFloor( GetDouble() );
         if ( nYear < 100 )
             nYear = pFormatter->ExpandTwoDigitYear( nYear );
+        if (nYear < 1583 || nYear > 9956)
+        {
+            // Valid Gregorian and maximum year constraints not met.
+            PushIllegalArgument();
+            return;
+        }
         // don't worry, be happy :)
         int B,C,D,E,F,G,H,I,K,L,M,N,O;
         N = nYear % 19;


More information about the Libreoffice-commits mailing list