File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -870,8 +870,7 @@ PHP_FUNCTION(proc_open)
870
870
}
871
871
} else if (strcmp (Z_STRVAL_P (ztype ), "redirect" ) == 0 ) {
872
872
zval * ztarget = zend_hash_index_find_deref (Z_ARRVAL_P (descitem ), 1 );
873
- struct php_proc_open_descriptor_item * target = NULL ;
874
- php_file_descriptor_t childend ;
873
+ php_file_descriptor_t childend = -1 ;
875
874
876
875
if (!ztarget ) {
877
876
zend_value_error ("Missing redirection target" );
@@ -884,13 +883,12 @@ PHP_FUNCTION(proc_open)
884
883
885
884
for (i = 0 ; i < ndesc ; i ++ ) {
886
885
if (descriptors [i ].index == Z_LVAL_P (ztarget )) {
887
- target = & descriptors [i ];
886
+ childend = descriptors [i ]. childend ;
888
887
break ;
889
888
}
890
889
}
891
- if (target ) {
892
- childend = target -> childend ;
893
- } else {
890
+
891
+ if (childend == -1 ) {
894
892
if (Z_LVAL_P (ztarget ) < 0 || Z_LVAL_P (ztarget ) > 2 ) {
895
893
php_error_docref (NULL , E_WARNING ,
896
894
"Redirection target " ZEND_LONG_FMT " not found" , Z_LVAL_P (ztarget ));
You can’t perform that action at this time.
0 commit comments