svn: /pecl/mysqlnd_ms/trunk/ mysqlnd_ms_filter_user.c
| From: | Ulf Wendel | Date: | Wed, 07 Dec 2011 19:06:51 +0000 |
| Subject: | svn: /pecl/mysqlnd_ms/trunk/ mysqlnd_ms_filter_user.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-17318@lists.php.net to get a copy of this message | ||
uw Wed, 07 Dec 2011 19:06:51 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=320602
Log:
Bail about wrong return value
Changed paths:
U pecl/mysqlnd_ms/trunk/mysqlnd_ms_filter_user.c
Modified: pecl/mysqlnd_ms/trunk/mysqlnd_ms_filter_user.c
===================================================================
--- pecl/mysqlnd_ms/trunk/mysqlnd_ms_filter_user.c 2011-12-07 19:06:25 UTC (rev 320601)
+++ pecl/mysqlnd_ms/trunk/mysqlnd_ms_filter_user.c 2011-12-07 19:06:51 UTC (rev 320602)
@@ -457,6 +457,12 @@
if (retval) {
if (Z_TYPE_P(retval) != IS_ARRAY) {
DBG_ERR("The user returned no array");
+ char error_buf[256];
+ snprintf(error_buf, sizeof(error_buf), MYSQLND_MS_ERROR_PREFIX " User multi filter
callback has not returned a list of servers to use. The callback must return an array");
+ error_buf[sizeof(error_buf) - 1] = '\0';
+ SET_CLIENT_ERROR((*error_info), CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, error_buf);
+ DBG_ERR_FMT("%s", error_buf);
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "%s", error_buf);
} else {
do {
HashPosition hash_pos;
@@ -556,7 +562,16 @@
} while (0);
}
zval_ptr_dtor(&retval);
+ } else {
+ char error_buf[256];
+ snprintf(error_buf, sizeof(error_buf), MYSQLND_MS_ERROR_PREFIX " User multi filter callback
has not returned a list of servers to use. The callback must return an array");
+ error_buf[sizeof(error_buf) - 1] = '\0';
+ SET_CLIENT_ERROR((*error_info), CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE, error_buf);
+ DBG_ERR_FMT("%s", error_buf);
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "%s", error_buf);
}
+
+
/* destroy the params */
{
unsigned int i;