File tree 3 files changed +25
-0
lines changed 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ PHP NEWS
12
12
. Fix memory leak in syslog device handling. (danog)
13
13
. Fixed bug GH-12621 (browscap segmentation fault when configured in the
14
14
vhost). (nielsdos)
15
+ . Fixed bug GH-12655 (proc_open() does not take into account references
16
+ in the descriptor array). (nielsdos)
15
17
16
18
- SQLite3:
17
19
. Fixed bug GH-12633 (sqlite3_defensive.phpt fails with sqlite 3.44.0).
Original file line number Diff line number Diff line change @@ -1096,6 +1096,7 @@ PHP_FUNCTION(proc_open)
1096
1096
1097
1097
descriptors [ndesc ].index = (int )nindex ;
1098
1098
1099
+ ZVAL_DEREF (descitem );
1099
1100
if (Z_TYPE_P (descitem ) == IS_RESOURCE ) {
1100
1101
if (set_proc_descriptor_from_resource (descitem , & descriptors [ndesc ], ndesc ) == FAILURE ) {
1101
1102
goto exit_fail ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-12655 (proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams [Descriptor item must be either an array or a File-Handle])
3
+ --FILE--
4
+ <?php
5
+
6
+ $ descriptor_spec = [
7
+ 0 => [ "pipe " , "r " ], // stdin is a pipe that the child will read from
8
+ 1 => [ "pipe " , "w " ], // stdout is a pipe that the child will write to
9
+ 2 => [ "pipe " , "w " ], // stderr is a file to write to
10
+ ];
11
+
12
+ foreach ( $ descriptor_spec as $ fd => &$ d )
13
+ {
14
+ // don't do anything, just the fact that we used "&$d" will sink the ship!
15
+ }
16
+
17
+ $ proc = proc_open (PHP_BINARY , $ descriptor_spec , $ pipes );
18
+ echo $ proc === false ? "FAILED \n" : "SUCCEEDED \n" ;
19
+
20
+ ?>
21
+ --EXPECT--
22
+ SUCCEEDED
You can’t perform that action at this time.
0 commit comments