Skip to content

Commit 963c1be

Browse files
committed
Merge branch 'PHP-5.5'
1 parent cb8d1fc commit 963c1be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/mysqlnd/mysqlnd.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS
12611261
static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC)
12621262
{
12631263
php_socket_t this_fd;
1264+
php_stream *stream = NULL;
12641265
int cnt = 0;
12651266
MYSQLND **p = conn_array;
12661267

@@ -1270,7 +1271,8 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
12701271
* when casting. It is only used here so that the buffered data warning
12711272
* is not displayed.
12721273
* */
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,
12741276
(void*)&this_fd, 1) && this_fd >= 0) {
12751277

12761278
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
12881290
static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC)
12891291
{
12901292
php_socket_t this_fd;
1293+
php_stream *stream = NULL;
12911294
int ret = 0;
12921295
zend_bool disproportion = FALSE;
12931296

12941297

12951298
MYSQLND **fwd = conn_array, **bckwd = conn_array;
12961299

12971300
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,
12991303
(void*)&this_fd, 1) && this_fd >= 0) {
13001304
if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
13011305
if (disproportion) {

0 commit comments

Comments
 (0)