@@ -1261,6 +1261,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS
1261
1261
static int mysqlnd_stream_array_to_fd_set (MYSQLND * * conn_array , fd_set * fds , php_socket_t * max_fd TSRMLS_DC )
1262
1262
{
1263
1263
php_socket_t this_fd ;
1264
+ php_stream * stream = NULL ;
1264
1265
int cnt = 0 ;
1265
1266
MYSQLND * * p = conn_array ;
1266
1267
@@ -1270,7 +1271,8 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
1270
1271
* when casting. It is only used here so that the buffered data warning
1271
1272
* is not displayed.
1272
1273
* */
1273
- if (SUCCESS == php_stream_cast ((* p )-> data -> net -> data -> m .get_stream ((* p )-> data -> net TSRMLS_CC ), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1274
+ stream = (* p )-> data -> net -> data -> m .get_stream ((* p )-> data -> net TSRMLS_CC );
1275
+ if (stream != NULL && SUCCESS == php_stream_cast (stream , PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1274
1276
(void * )& this_fd , 1 ) && this_fd >= 0 ) {
1275
1277
1276
1278
PHP_SAFE_FD_SET (this_fd , fds );
@@ -1288,14 +1290,16 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
1288
1290
static int mysqlnd_stream_array_from_fd_set (MYSQLND * * conn_array , fd_set * fds TSRMLS_DC )
1289
1291
{
1290
1292
php_socket_t this_fd ;
1293
+ php_stream * stream = NULL ;
1291
1294
int ret = 0 ;
1292
1295
zend_bool disproportion = FALSE;
1293
1296
1294
1297
1295
1298
MYSQLND * * fwd = conn_array , * * bckwd = conn_array ;
1296
1299
1297
1300
while (* fwd ) {
1298
- if (SUCCESS == php_stream_cast ((* fwd )-> data -> net -> data -> m .get_stream ((* fwd )-> data -> net TSRMLS_CC ), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1301
+ stream = (* fwd )-> data -> net -> data -> m .get_stream ((* fwd )-> data -> net TSRMLS_CC );
1302
+ if (stream != NULL && SUCCESS == php_stream_cast (stream , PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL ,
1299
1303
(void * )& this_fd , 1 ) && this_fd >= 0 ) {
1300
1304
if (PHP_SAFE_FD_ISSET (this_fd , fds )) {
1301
1305
if (disproportion ) {
0 commit comments