]> granicus.if.org Git - php/commitdiff
Check that the type is correct
authorStanislav Malyshev <stas@php.net>
Mon, 23 Mar 2015 01:17:47 +0000 (18:17 -0700)
committerStanislav Malyshev <stas@php.net>
Mon, 23 Mar 2015 01:17:47 +0000 (18:17 -0700)
ext/standard/incomplete_class.c

index 1816ac4605be4fab0e97aa6702398a0a82133e45..30c82e67e6750f9b2d6160aea1ededa7ac48010c 100644 (file)
@@ -144,7 +144,7 @@ PHPAPI char *php_lookup_class_name(zval *object, zend_uint *nlen)
 
        object_properties = Z_OBJPROP_P(object);
 
-       if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS) {
+       if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS && Z_TYPE_PP(val) == IS_STRING) {
                retval = estrndup(Z_STRVAL_PP(val), Z_STRLEN_PP(val));
 
                if (nlen) {