summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-07-22 10:35:26 +0200
committerAnatol Belski <ab@php.net>2017-07-22 10:35:26 +0200
commite405ff59f9e5873a3aa8dc6b7175708d424007b9 (patch)
tree86cf2158f74802f5b38d2e967f8336c7972f313e /ext/mysqli/mysqli.c
parent256ec5bebb04d9fdea55951d8bb26eed659adf66 (diff)
downloadphp-git-e405ff59f9e5873a3aa8dc6b7175708d424007b9.tar.gz
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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 481b46c7c4..04f07a5c93 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1251,6 +1251,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) {