mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fixed bug #77494 (Disabling class causes segfault on member access)
This commit is contained in:
commit
aa9a8dbda3
3 changed files with 30 additions and 0 deletions
3
NEWS
3
NEWS
|
@ -1,6 +1,9 @@
|
|||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 7.3.3
|
||||
-Core:
|
||||
. Fixed bug #77494 (Disabling class causes segfault on member access).
|
||||
(Dmitry)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #77287 (Opcache literal compaction is incompatible with EXT
|
||||
|
|
16
Zend/tests/bug77494.phpt
Normal file
16
Zend/tests/bug77494.phpt
Normal file
|
@ -0,0 +1,16 @@
|
|||
--TEST--
|
||||
Bug #77494 (Disabling class causes segfault on member access)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) exit("skip curl extension not loaded"); ?>
|
||||
--INI--
|
||||
disable_classes=CURLFile
|
||||
--FILE--
|
||||
<?php
|
||||
$a = new CURLFile();
|
||||
var_dump($a->name);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: CURLFile() has been disabled for security reasons in %sbug77494.php on line 2
|
||||
|
||||
Notice: Undefined property: CURLFile::$name in %sbug77494.php on line 3
|
||||
NULL
|
|
@ -2861,6 +2861,17 @@ static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{
|
|||
zend_object *intern;
|
||||
|
||||
intern = zend_objects_new(class_type);
|
||||
|
||||
/* Initialize default properties */
|
||||
if (EXPECTED(class_type->default_properties_count != 0)) {
|
||||
zval *p = intern->properties_table;
|
||||
zval *end = p + class_type->default_properties_count;
|
||||
do {
|
||||
ZVAL_UNDEF(p);
|
||||
p++;
|
||||
} while (p != end);
|
||||
}
|
||||
|
||||
zend_error(E_WARNING, "%s() has been disabled for security reasons", ZSTR_VAL(class_type->name));
|
||||
return intern;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue