Skip to content

Commit 0777a18

Browse files
committed
Merge branch 'PHP-5.3' into PHP-5.4
Conflicts: NEWS
2 parents a328cc4 + f1e2edf commit 0777a18

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ PHP NEWS
2323
- Mbstring:
2424
. mb_split() can now handle empty matches like preg_split() does. (Moriyoshi)
2525

26+
- mysqlnd
27+
. Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
28+
for stmt->param_bind). (Andrey)
29+
2630
- OpenSSL:
2731
. New SSL stream context option to prevent CRIME attack vector. (Daniel Lowrey,
2832
Lars)

ext/mysqlnd/mysqlnd_ps.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
14781478

14791479
if (stmt->param_count) {
14801480
if (!stmt->param_bind) {
1481-
stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
1481+
stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent);
14821482
if (!stmt->param_bind) {
14831483
DBG_RETURN(FAIL);
14841484
}

ext/pdo_mysql/mysql_statement.c

+7-13
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
343343
pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data;
344344
pdo_mysql_db_handle *H = S->H;
345345
long row_count;
346-
int ret;
347346
PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset");
348347
PDO_DBG_INF_FMT("stmt=%p", S->stmt);
349348

@@ -412,26 +411,21 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
412411
S->result = NULL;
413412
}
414413

415-
ret = mysql_next_result(H->server);
414+
if (!mysql_more_results(H->server)) {
415+
/* No more results */
416+
PDO_DBG_RETURN(0);
417+
}
416418
#if PDO_USE_MYSQLND
417-
/* for whatever reason mysqlnd breaks with libmysql compatibility at the C level, no -1 */
418-
if (PASS != ret) {
419+
if (mysql_next_result(H->server) == FAIL) {
419420
pdo_mysql_error_stmt(stmt);
420421
PDO_DBG_RETURN(0);
421-
}
422-
if (mysql_more_results(H->server)) {
423-
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
424422
} else {
425-
/* No more results */
426-
PDO_DBG_RETURN(0);
423+
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
427424
}
428425
#else
429-
if (ret > 0) {
426+
if (mysql_next_result(H->server) > 0) {
430427
pdo_mysql_error_stmt(stmt);
431428
PDO_DBG_RETURN(0);
432-
} else if (ret < 0) {
433-
/* No more results */
434-
PDO_DBG_RETURN(0);
435429
} else {
436430
PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
437431
}

0 commit comments

Comments
 (0)