We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d80d98 commit 237bb37Copy full SHA for 237bb37
ext/calendar/gregor.c
@@ -153,6 +153,10 @@ void SdnToGregorian(
153
}
154
temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1;
155
156
+ if (temp < 0 || (temp / DAYS_PER_400_YEARS) > INT_MAX) {
157
+ goto fail;
158
+ }
159
+
160
/* Calculate the century (year/100). */
161
century = temp / DAYS_PER_400_YEARS;
162
ext/calendar/tests/gh16235.phpt
@@ -0,0 +1,11 @@
1
+--TEST--
2
+GH-16235 (jdtogregorian overflow on argument)
3
+--EXTENSIONS--
4
+calendar
5
+--FILE--
6
+<?php
7
+jdtogregorian(92233658792494800);
8
+echo "DONE";
9
+?>
10
+--EXPECT--
11
+DONE
0 commit comments