File tree Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Expand file tree Collapse file tree 3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 55- Calendar:
66  . Fixed jdtogregorian overflow. (David Carlier)
77
8+ - FPM:
9+   . Fixed GH-16432 (PHP-FPM 8.2 SIGSEGV in fpm_get_status). (Jakub Zelenka)
10+ 
811- PDO:
912  . Fixed memory leak of `setFetchMode()`. (SakiTakamachi)
1013
Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ int fpm_status_export_to_zval(zval *status)
6262
6363	/* copy the scoreboard not to bother other processes */ 
6464	scoreboard  =  * scoreboard_p ;
65- 	struct  fpm_scoreboard_proc_s  procs [scoreboard .nprocs ];
65+ 	struct  fpm_scoreboard_proc_s  * procs  =  safe_emalloc (
66+ 			sizeof (struct  fpm_scoreboard_proc_s ), scoreboard .nprocs , 0 );
6667
6768	struct  fpm_scoreboard_proc_s  * proc_p ;
6869	for (i = 0 ; i < scoreboard .nprocs ; i ++ ) {
@@ -131,6 +132,8 @@ int fpm_status_export_to_zval(zval *status)
131132		add_next_index_zval (& fpm_proc_stats , & fpm_proc_stat );
132133	}
133134	add_assoc_zval (status , "procs" , & fpm_proc_stats );
135+ 	efree (procs );
136+ 
134137	return  0 ;
135138}
136139/* }}} */ 
Original file line number Diff line number Diff line change 1+ --TEST--
2+ FPM: GH-16432 - fpm_get_status segfault on high nprocs
3+ --SKIPIF--
4+ <?php  include  "skipif.inc " ; ?> 
5+ --FILE--
6+ <?php 
7+ 
8+ require_once  "tester.inc " ;
9+ 
10+ $ cfg<<<EOT 
11+ [global] 
12+ error_log = {{FILE:LOG}} 
13+ log_level = notice 
14+ [unconfined] 
15+ listen = {{ADDR}} 
16+ pm = dynamic 
17+ pm.max_children = 12800 
18+ pm.start_servers = 1 
19+ pm.min_spare_servers = 1 
20+ pm.max_spare_servers = 1 
21+ catch_workers_output = yes 
22+ EOT ;
23+ 
24+ $ code<<<EOT 
25+ <?php 
26+ var_dump(empty(fpm_get_status())); 
27+ EOT ;
28+ 
29+ $ testernew  FPM \Tester ($ cfg$ code
30+ [$ sourceFilePath$ scriptName$ testercreateSourceFileAndScriptName ();
31+ $ testerstart ();
32+ $ testerexpectLogStartNotices ();
33+ $ testerrequest ()->expectBody ('bool(false) ' );
34+ $ testerterminate ();
35+ $ testerexpectLogTerminatingNotices ();
36+ $ testerclose ();
37+ 
38+ ?> 
39+ Done
40+ --EXPECT--
41+ Done
42+ --CLEAN--
43+ <?php 
44+ require_once  "tester.inc " ;
45+ FPM \Tester::clean ();
46+ ?> 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments