File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 22|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33?? ??? ????, PHP 8.4.0
44
5+ - Calendar:
6+   . Fixed jdtogregorian overflow. (David Carlier)
7+ 
58- PDO:
69  . Fixed memory leak of `setFetchMode()`. (SakiTakamachi)
710
Original file line number Diff line number Diff line change @@ -148,11 +148,15 @@ void SdnToGregorian(
148148	int  dayOfYear ;
149149
150150	if  (sdn  <= 0  || 
151- 			sdn  >  (LONG_MAX  -  4  *  GREGOR_SDN_OFFSET ) / 4 ) {
151+ 			sdn  >  (ZEND_LONG_MAX  -  4  *  GREGOR_SDN_OFFSET ) / 4 ) {
152152		goto fail ;
153153	}
154154	temp  =  (sdn  +  GREGOR_SDN_OFFSET ) *  4  -  1 ;
155155
156+ 	if  (temp  <  0  ||  (temp  / DAYS_PER_400_YEARS ) >  INT_MAX ) {
157+ 		goto fail ;
158+ 	}
159+ 
156160	/* Calculate the century (year/100). */ 
157161	century  =  temp  / DAYS_PER_400_YEARS ;
158162
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-16235 (jdtogregorian overflow on argument)
3+ --EXTENSIONS--
4+ calendar
5+ --FILE--
6+ <?php 
7+ jdtogregorian (536838867 );
8+ echo  "DONE " ;
9+ ?> 
10+ --EXPECT--
11+ DONE
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments