com php-src: Prevent crash in case of SQL error: ext/pdo_mysq l/mysql_statement.c

From: Date: Mon, 19 May 2014 07:52:33 +0000
Subject: com php-src: Prevent crash in case of SQL error: ext/pdo_mysq l/mysql_statement.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78463@lists.php.net to get a copy of this message
Commit: 4e521c92ec7c713bb1bdf0f25593d8d1871ae883 Author: Dmitry Stogov <dmitry@zend.com> Mon, 19 May 2014 11:52:33 +0400 Parents: 4ea10696e8ffc3779f0cc73ab11c2214ab2bed47 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4e521c92ec7c713bb1bdf0f25593d8d1871ae883 Log: Prevent crash in case of SQL error Changed paths: M ext/pdo_mysql/mysql_statement.c Diff: diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index df3a395..18d960c 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -404,7 +404,9 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */ /* ensure that we free any previous unfetched results */ #ifndef PDO_USE_MYSQLND if (S->stmt) { - stmt->column_count = (int)mysql_num_fields(S->result); + if (S->result) { + stmt->column_count = (int)mysql_num_fields(S->result); + } mysql_stmt_free_result(S->stmt); } #endif

« previous php.cvs (#78463) next »