File tree 3 files changed +53
-1
lines changed
3 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 5
5
- Calendar:
6
6
. Fixed jdtogregorian overflow. (David Carlier)
7
7
8
+ - FPM:
9
+ . Fixed GH-16432 (PHP-FPM 8.2 SIGSEGV in fpm_get_status). (Jakub Zelenka)
10
+
8
11
- PDO:
9
12
. Fixed memory leak of `setFetchMode()`. (SakiTakamachi)
10
13
Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ int fpm_status_export_to_zval(zval *status)
62
62
63
63
/* copy the scoreboard not to bother other processes */
64
64
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 );
66
67
67
68
struct fpm_scoreboard_proc_s * proc_p ;
68
69
for (i = 0 ; i < scoreboard .nprocs ; i ++ ) {
@@ -131,6 +132,8 @@ int fpm_status_export_to_zval(zval *status)
131
132
add_next_index_zval (& fpm_proc_stats , & fpm_proc_stat );
132
133
}
133
134
add_assoc_zval (status , "procs" , & fpm_proc_stats );
135
+ efree (procs );
136
+
134
137
return 0 ;
135
138
}
136
139
/* }}} */
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
+ $ tester = new FPM \Tester ($ cfg , $ code );
30
+ [$ sourceFilePath , $ scriptName ] = $ tester ->createSourceFileAndScriptName ();
31
+ $ tester ->start ();
32
+ $ tester ->expectLogStartNotices ();
33
+ $ tester ->request ()->expectBody ('bool(false) ' );
34
+ $ tester ->terminate ();
35
+ $ tester ->expectLogTerminatingNotices ();
36
+ $ tester ->close ();
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