File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 99 bypassable due to the environment variable collision). (CVE-2024-8927)
1010 (nielsdos)
1111
12+ - Calendar:
13+ . Fixed GH-16240: jdtounix overflow on argument value. (David Carlier)
14+
1215- CLI:
1316 . Fixed bug GH-16137: duplicate http headers when set several times by
1417 the client. (David Carlier)
Original file line number Diff line number Diff line change @@ -60,13 +60,13 @@ PHP_FUNCTION(jdtounix)
6060 if (zend_parse_parameters (ZEND_NUM_ARGS (), "l" , & uday ) == FAILURE ) {
6161 RETURN_THROWS ();
6262 }
63- uday -= 2440588 /* J.D. of 1.1.1970 */ ;
64-
65- if (uday < 0 || uday > ZEND_LONG_MAX / SECS_PER_DAY ) { /* before beginning of unix epoch or greater than representable */
63+ if (uday < 2440588 || (uday - 2440588 ) > (ZEND_LONG_MAX / SECS_PER_DAY )) { /* before beginning of unix epoch or greater than representable */
6664 zend_value_error ("jday must be between 2440588 and " ZEND_LONG_FMT , ZEND_LONG_MAX / SECS_PER_DAY + 2440588 );
6765 RETURN_THROWS ();
6866 }
6967
68+ uday -= 2440588 /* J.D. of 1.1.1970 */ ;
69+
7070 RETURN_LONG (uday * SECS_PER_DAY );
7171}
7272/* }}} */
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-16231 (jdtounix argument overflow)
3+ --EXTENSIONS--
4+ calendar
5+ --FILE--
6+ <?php
7+ try {
8+ jdtounix (PHP_INT_MIN );
9+ } catch (\ValueError $ e ) {
10+ echo $ e ->getMessage () . PHP_EOL ;
11+ }
12+
13+ try {
14+ jdtounix (240587 );
15+ } catch (\ValueError $ e ) {
16+ echo $ e ->getMessage ();
17+ }
18+ ?>
19+ --EXPECTF--
20+ jday must be between 2440588 and %d
21+ jday must be between 2440588 and %d
You can’t perform that action at this time.
0 commit comments