php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56664 copying __set/__get leads to SEGFAULT
Submitted: 2005-11-20 10:17 UTC Modified: 2013-02-23 19:00 UTC
From: jobapply at nextmail dot ru Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5_1 CVS-2005-11-20 OS: FreeBSD 5
Private report: No CVE-ID: None
 [2005-11-20 10:17 UTC] jobapply at nextmail dot ru
Description:
------------
Copying __set/__get from one class to another leads to segmentation fault.

Not sure about __call/__wakeup/__sleep (magic methods).

Reproduce code:
---------------
class SetGetMix {

	public function __get($name) { 
		return 10;
	}
}

class Example  { }

runkit_method_copy( 'Example', '__get', 'SetGetMix');

$e = new Example();

echo $e->a;



Expected result:
----------------
10

Actual result:
--------------
Segmentation Fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-20 10:21 UTC] jobapply at nextmail dot ru
-bash-2.05b# php reproduce.php

PHP Fatal error:  Possible integer overflow in memory allocation (20 * 140401460 + 0) in `??? on line 17

Fatal error: Possible integer overflow in memory allocation (20 * 140401460 + 0) in `??? on line 17
 [2013-02-23 19:00 UTC] pollita@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pollita
 [2013-02-23 19:00 UTC] pollita@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 04 01:01:29 2024 UTC