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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jobapply at nextmail dot ru
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Tue May 11 13:01:24 2021 UTC