@@ -1142,6 +1142,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS
1142
1142
static int mysqlnd_stream_array_to_fd_set (MYSQLND * * conn_array , fd_set * fds , php_socket_t * max_fd TSRMLS_DC )
1143
1143
{
1144
1144
php_socket_t this_fd ;
1145
+ php_stream * stream = NULL ;
1145
1146
int cnt = 0 ;
1146
1147
MYSQLND * * p = conn_array ;
1147
1148
@@ -1151,7 +1152,8 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
1151
1152
* when casting. It is only used here so that the buffered data warning
1152
1153
* is not displayed.
1153
1154
* */
1154
- if (SUCCESS == php_stream_cast ((* p )-> data -> net -> stream , PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1155
+ stream = (* p )-> data -> net -> stream ;
1156
+ if (stream != NULL && SUCCESS == php_stream_cast (stream , PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1155
1157
(void * )& this_fd , 1 ) && this_fd >= 0 ) {
1156
1158
1157
1159
PHP_SAFE_FD_SET (this_fd , fds );
@@ -1169,14 +1171,16 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
1169
1171
static int mysqlnd_stream_array_from_fd_set (MYSQLND * * conn_array , fd_set * fds TSRMLS_DC )
1170
1172
{
1171
1173
php_socket_t this_fd ;
1174
+ php_stream * stream = NULL ;
1172
1175
int ret = 0 ;
1173
1176
zend_bool disproportion = FALSE;
1174
1177
1175
1178
1176
1179
MYSQLND * * fwd = conn_array , * * bckwd = conn_array ;
1177
1180
1178
1181
while (* fwd ) {
1179
- if (SUCCESS == php_stream_cast ((* fwd )-> data -> net -> stream , PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1182
+ stream = (* fwd )-> data -> net -> stream ;
1183
+ if (stream != NULL && SUCCESS == php_stream_cast (stream , PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1180
1184
(void * )& this_fd , 1 ) && this_fd >= 0 ) {
1181
1185
if (PHP_SAFE_FD_ISSET (this_fd , fds )) {
1182
1186
if (disproportion ) {
0 commit comments