[Bug 1198882] Re: __toString() which stores $this reference triggers segfault

Alexey Skryabin rip84 at bk.ru
Wed Aug 28 06:49:25 UTC 2013


** Description changed:

- DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
- php --version
- PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch 
+ Description:
+ Passing object with __toString() causes segfault in random script iteration. When casted to string beforehand, it runs OK.
  
+ Test case:
  Code as
  <?php
  
  class A {
          public $a;
          public function __toString()
          {
                  $this->a = $this;
                  return 'waa?';
          }
  }
  
  $a = new A;
  echo trim($a);
  echo trim($a->a);
  
  ?>
  crashes in CLI, and run as php mod in apache
+ 
+ Enviroment:
+ DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
+ php --version
+ PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch

** Changed in: php5 (Ubuntu)
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in Ubuntu.
https://bugs.launchpad.net/bugs/1198882

Title:
  __toString() which stores $this reference triggers segfault

To manage notifications about this bug go to:
https://bugs.launchpad.net/php/+bug/1198882/+subscriptions



More information about the Ubuntu-server-bugs mailing list