com php-src: Prevent crash on ext/pdo_mysql/tests/bug_3 9858.phpt when built with libmysql: ext/p do/pdo_stmt.c
| From: | Dmitry Stogov | Date: | Mon, 16 Oct 2017 16:00:12 +0000 |
| Subject: | com php-src: Prevent crash on ext/pdo_mysql/tests/bug_3 9858.phpt when built with libmysql: ext/p do/pdo_stmt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99763@lists.php.net to get a copy of this message | ||
Commit: 8bfe748fb0f58dfb21cbd1018e2e78457d354de1
Author: Dmitry Stogov <dmitry@zend.com> Mon, 16 Oct 2017 19:00:12 +0300
Parents: 999fe36d404a375864202a1b2d90de111ddd1b25
Branches: PHP-7.0 PHP-7.1 PHP-7..2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8bfe748fb0f58dfb21cbd1018e2e78457d354de1
Log:
Prevent crash on ext/pdo_mysql/tests/bug_39858.phpt when built with libmysql
Changed paths:
M ext/pdo/pdo_stmt.c
Diff:
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index c2c6565..a2c8092 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2025,7 +2025,9 @@ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt)
struct pdo_column_data *cols = stmt->columns;
for (i = 0; i < stmt->column_count; i++) {
- zend_string_release(cols[i].name);
+ if (cols[i]..name) {
+ zend_string_release(cols[i].name);
+ }
}
efree(stmt->columns);
stmt->columns = NULL;