diff options
author | Anatol Belski <ab@php.net> | 2017-07-22 10:36:31 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-07-22 10:36:31 +0200 |
commit | 4cb1151fff357273d82357492ceaa1033de9608e (patch) | |
tree | 928e4aff674372c8fa95894e879b4a28c660d9c0 /ext/mysqli/mysqli.c | |
parent | 69ec51eb0221c76802a5a23e1c86cad1483faed2 (diff) | |
parent | e405ff59f9e5873a3aa8dc6b7175708d424007b9 (diff) | |
download | php-git-4cb1151fff357273d82357492ceaa1033de9608e.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r-- | ext/mysqli/mysqli.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 15cb4bc23b..56b88c4827 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1244,6 +1244,10 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags php_error_docref(NULL, E_WARNING, "Could not find class '%s'", ZSTR_VAL(class_name)); return; } + if (UNEXPECTED(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) { + zend_throw_error(NULL, "Class '%s' cannot be instantiated", ZSTR_VAL(ce->name)); + return; + } fetchtype = MYSQLI_ASSOC; } else { if (override_flags) { |