com php-src: Check for null dbh methods in get_gc: ext/pd o/pdo_dbh.c

From: Date: Wed, 28 Oct 2020 09:44:13 +0000
Subject: com php-src: Check for null dbh methods in get_gc: ext/pd o/pdo_dbh.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-113954@lists.php.net to get a copy of this message
Commit: ab0ec3f24a2510043b15d17b91c24fc36067113c Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 28 Oct 2020 10:44:13 +0100 Parents: a49200a031aecc3f3b2c03a006dfa001d9c8dfff Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ab0ec3f24a2510043b15d17b91c24fc36067113c Log: Check for null dbh methods in get_gc Methods may not be set at the point where get_gc is called. Fixes a segfault in Laravel. Changed paths: M ext/pdo/pdo_dbh.c Diff: diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 4fa43544cb0..ceb2ea11499 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1297,7 +1297,7 @@ static HashTable *dbh_get_gc(zend_object *object, zval **gc_data, int *gc_count) pdo_dbh_t *dbh = php_pdo_dbh_fetch_inner(object); zend_get_gc_buffer *gc_buffer = zend_get_gc_buffer_create(); zend_get_gc_buffer_add_zval(gc_buffer, &dbh->def_stmt_ctor_args); - if (dbh->methods->get_gc) { + if (dbh->methods && dbh->methods->get_gc) { dbh->methods->get_gc(dbh, gc_buffer); } zend_get_gc_buffer_use(gc_buffer, gc_data, gc_count);

« previous php.cvs (#113954) next »