--- embedaddon/php/ext/mysqlnd/mysqlnd.c 2013/07/22 01:31:56 1.1.1.3 +++ embedaddon/php/ext/mysqlnd/mysqlnd.c 2013/10/14 08:02:25 1.1.1.4 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mysqlnd.c,v 1.1.1.3 2013/07/22 01:31:56 misho Exp $ */ +/* $Id: mysqlnd.c,v 1.1.1.4 2013/10/14 08:02:25 misho Exp $ */ #include "php.h" #include "mysqlnd.h" #include "mysqlnd_wireprotocol.h" @@ -1061,7 +1061,7 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query); - enum_func_status ret; + enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::send_query"); DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); @@ -1142,6 +1142,7 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MY static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC) { php_socket_t this_fd; + php_stream *stream = NULL; int cnt = 0; MYSQLND **p = conn_array; @@ -1151,7 +1152,8 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** c * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - if (SUCCESS == php_stream_cast((*p)->data->net->stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + stream = (*p)->data->net->stream; + if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { PHP_SAFE_FD_SET(this_fd, fds); @@ -1169,6 +1171,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** c static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC) { php_socket_t this_fd; + php_stream *stream = NULL; int ret = 0; zend_bool disproportion = FALSE; @@ -1176,7 +1179,8 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** MYSQLND **fwd = conn_array, **bckwd = conn_array; while (*fwd) { - if (SUCCESS == php_stream_cast((*fwd)->data->net->stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, + stream = (*fwd)->data->net->stream; + if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd >= 0) { if (PHP_SAFE_FD_ISSET(this_fd, fds)) { if (disproportion) { @@ -1468,7 +1472,7 @@ static ulong MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC) { size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string); - ulong ret; + ulong ret = FAIL; DBG_ENTER("mysqlnd_conn_data::escape_string"); DBG_INF_FMT("conn=%llu", conn->thread_id);