summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_warning.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-10-10 12:57:55 +0000
committerAntony Dovgal <tony2001@php.net>2005-10-10 12:57:55 +0000
commit410e106aae60ad267b7238a4808030d0bec7d254 (patch)
tree32a1bd5049ee5accc0a69743298086d55151e1bf /ext/mysqli/mysqli_warning.c
parent3019a1c6a39b27ca8a74b4726bd2629e22095aea (diff)
downloadphp-git-410e106aae60ad267b7238a4808030d0bec7d254.tar.gz
fix #34810 (mysqli::init() and others use wrong $this pointer without checks)
Diffstat (limited to 'ext/mysqli/mysqli_warning.c')
-rw-r--r--ext/mysqli/mysqli_warning.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index 3029d827cf..3ea578f6c7 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -201,8 +201,8 @@ PHP_METHOD(mysqli_warning, __construct)
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = mysqli_resource->info = (void *)w;
- if (!getThis()) {
- MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_link_class_entry);
+ if (!getThis() || !instanceof_function(Z_OBJCE_P(getThis()), mysqli_warning_class_entry TSRMLS_CC)) {
+ MYSQLI_RETURN_RESOURCE(mysqli_resource, mysqli_warning_class_entry);
} else {
((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource;
((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->valid = 1;