Sec Bug->Bug #81698 [Opn]: getType()->getName() crashes on dynamic properties

From: Date: Sat, 04 Dec 2021 19:57:45 +0000
Subject: Sec Bug->Bug #81698 [Opn]: getType()->getName() crashes on dynamic properties
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-238177@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81698&edit=1 ID: 81698 Updated by: nikic@php.net Reported by: richiruizmartinez at gmail dot com Summary: getType()->getName() crashes on dynamic properties Status: Open -Type: Security +Type: Bug Package: Reflection related Operating System: Ubuntu 20.04 PHP Version: 7.4.26 Block user comment: N Private report: Y Previous Comments: ------------------------------------------------------------------------ [2021-12-04 17:55:06] richiruizmartinez at gmail dot com Description: ------------ When I run the code shown below, PHP generates a segmentation fault. The object $o has a dynamic property $p. When trying to find out the type of $p, the segmentation fault appears. Test script: --------------- class C { } $o = new C(); $o->p = 0; $ro = new \ReflectionObject($o); foreach ($ro->getProperties() as $rp) { echo $rp->getType()->getName(); } Expected result: ---------------- segmentation fault (core dumped) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81698&edit=1

« previous php.bugs (#238177) next »