summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2013-03-13 14:24:23 +0100
committerAndrey Hristov <andrey@php.net>2013-03-13 14:24:23 +0100
commit0777a18703d9be2ea8efd85c0352863b8768e49e (patch)
treef8eb0f63a1064597c3f3ddeb6650e60e27332c2a
parenta328cc452e02ef9605518a1c1a0c97d91b87b846 (diff)
parentf1e2edff8befb7863723adbe5680ce3d9714d9ed (diff)
downloadphp-git-0777a18703d9be2ea8efd85c0352863b8768e49e.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
Conflicts: NEWS
-rw-r--r--NEWS4
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c2
-rw-r--r--ext/pdo_mysql/mysql_statement.c20
3 files changed, 12 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 1fbd5a2858..ac0c94346b 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,10 @@ PHP NEWS
- Mbstring:
. mb_split() can now handle empty matches like preg_split() does. (Moriyoshi)
+- mysqlnd
+ . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
+ for stmt->param_bind). (Andrey)
+
- OpenSSL:
. New SSL stream context option to prevent CRIME attack vector. (Daniel Lowrey,
Lars)
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 99bd021593..cd5b302275 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -1478,7 +1478,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
if (stmt->param_count) {
if (!stmt->param_bind) {
- stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
+ stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent);
if (!stmt->param_bind) {
DBG_RETURN(FAIL);
}
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index f2e36c1719..2ae559571d 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -343,7 +343,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
pdo_mysql_db_handle *H = S->H;
long row_count;
- int ret;
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
@@ -412,26 +411,21 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
S->result = NULL;
}
- ret = mysql_next_result(H->server);
+ if (!mysql_more_results(H->server)) {
+ /* No more results */
+ PDO_DBG_RETURN(0);
+ }
#if PDO_USE_MYSQLND
- /* for whatever reason mysqlnd breaks with libmysql compatibility at the C level, no -1 */
- if (PASS != ret) {
+ if (mysql_next_result(H->server) == FAIL) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
- }
- if (mysql_more_results(H->server)) {
- PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
} else {
- /* No more results */
- PDO_DBG_RETURN(0);
+ PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
}
#else
- if (ret > 0) {
+ if (mysql_next_result(H->server) > 0) {
pdo_mysql_error_stmt(stmt);
PDO_DBG_RETURN(0);
- } else if (ret < 0) {
- /* No more results */
- PDO_DBG_RETURN(0);
} else {
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
}