File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 2
2
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3
3
?? ??? 2022, PHP 8.0.23
4
4
5
+ - Standard:
6
+ . Fixed bug GH-9017 (php_stream_sock_open_from_socket could return NULL).
7
+ (Heiko Weber)
5
8
6
9
04 Aug 2022, PHP 8.0.22
7
10
Original file line number Diff line number Diff line change @@ -67,10 +67,22 @@ PHP_FUNCTION(stream_socket_pair)
67
67
RETURN_FALSE ;
68
68
}
69
69
70
- array_init (return_value );
71
-
72
- s1 = php_stream_sock_open_from_socket (pair [0 ], 0 );
73
- s2 = php_stream_sock_open_from_socket (pair [1 ], 0 );
70
+ s1 = php_stream_sock_open_from_socket (pair [0 ], 0 );
71
+ if (s1 == NULL ) {
72
+ close (pair [0 ]);
73
+ close (pair [1 ]);
74
+ php_error_docref (NULL , E_WARNING , "Failed to open stream from socketpair" );
75
+ RETURN_FALSE ;
76
+ }
77
+ s2 = php_stream_sock_open_from_socket (pair [1 ], 0 );
78
+ if (s2 == NULL ) {
79
+ php_stream_free (s1 , PHP_STREAM_FREE_CLOSE );
80
+ close (pair [1 ]);
81
+ php_error_docref (NULL , E_WARNING , "Failed to open stream from socketpair" );
82
+ RETURN_FALSE ;
83
+ }
84
+
85
+ array_init (return_value );
74
86
75
87
/* set the __exposed flag.
76
88
* php_stream_to_zval() does, add_next_index_resource() does not */
You can’t perform that action at this time.
0 commit comments