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 9
9
bypassable due to the environment variable collision). (CVE-2024-8927)
10
10
(nielsdos)
11
11
12
+ - Calendar:
13
+ . Fixed GH-16240: jdtounix overflow on argument value. (David Carlier)
14
+
12
15
- CLI:
13
16
. Fixed bug GH-16137: duplicate http headers when set several times by
14
17
the client. (David Carlier)
Original file line number Diff line number Diff line change @@ -60,13 +60,13 @@ PHP_FUNCTION(jdtounix)
60
60
if (zend_parse_parameters (ZEND_NUM_ARGS (), "l" , & uday ) == FAILURE ) {
61
61
RETURN_THROWS ();
62
62
}
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 */
66
64
zend_value_error ("jday must be between 2440588 and " ZEND_LONG_FMT , ZEND_LONG_MAX / SECS_PER_DAY + 2440588 );
67
65
RETURN_THROWS ();
68
66
}
69
67
68
+ uday -= 2440588 /* J.D. of 1.1.1970 */ ;
69
+
70
70
RETURN_LONG (uday * SECS_PER_DAY );
71
71
}
72
72
/* }}} */
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