summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/interpr2.cxx')
-rw-r--r--sc/source/core/tool/interpr2.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 4a51f956be73..bd297494f195 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -287,6 +287,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;