From:             kameshj at fastmail dot fm
Operating system: Any Operating System
PHP version:      5.0.2
PHP Bug Type:     Reproducible crash
Bug description:  calling non existent function alias stored in a member array of an 
object

Description:
------------
Calling non existent function alias stored in a member array of an object
causes Segmentation fault. This happens in 
PHP-5.0.0
PHP-5.0.1
PHP-5.0.2
PHP-5.1 HEAD

The cause happened to be zend_do_begin_method_call in zend_compile.c.

Here the check exists to check the member method name is __clone. This
check causes a Segmentation fault.

Solution is check for the, 
last_op->op2.u.constant.type==IS_STRING before chceking for str.len and
zend_binary_strcasecmp.


This bug breaks the working of Xoops 2.0.8 PHP5.0 port of Xoops.

Reproduce code:
---------------
Segmentation fault case
<?php
$obj->kameaps[0]();
?>

Non Segmentation fault case

<?php
$obj->anymembernamenotequalto7insize[0]();
?>


Expected result:
----------------
Fatal error: Function name must be a string in %s on line %d

Actual result:
--------------
Segmentation fault.

-- 
Edit bug report at http://bugs.php.net/?id=30457&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30457&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30457&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30457&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30457&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30457&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30457&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30457&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30457&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30457&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30457&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30457&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30457&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30457&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30457&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30457&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30457&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30457&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30457&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30457&r=mysqlcfg

Reply via email to