php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30543 Extending to self or parent makes php crash
Submitted: 2004-10-23 17:00 UTC Modified: 2004-11-17 13:40 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jsgoupil at lookstrike dot com Assigned: andi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.2 OS: WinXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
5 - 2 = ?
Subscribe to this entry?

 
 [2004-10-23 17:00 UTC] jsgoupil at lookstrike dot com
Description:
------------
Everything is in the summary. When extending a class to parent or self (nobody does that uh :P ?), php crashes.

Reproduce code:
---------------
<?php
class a extends self {
}
?>

or

<?php
class a extends parent {
}
?>


Expected result:
----------------
Error like extending "extends" keyword ?

Actual result:
--------------
Crash !

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-23 17:21 UTC] tony2001@php.net
Andi, plz, review this fix:

Index: zend_execute_API.c
===================================================================
RCS file: /repository/ZendEngine2/zend_execute_API.c,v
retrieving revision 1.304
diff -u -r1.304 zend_execute_API.c
--- zend_execute_API.c  5 Oct 2004 06:53:39 -0000       1.304
+++ zend_execute_API.c  23 Oct 2004 15:20:05 -0000
@@ -884,6 +884,10 @@
        char dummy = 1;
        zend_fcall_info fcall_info;
        zend_fcall_info_cache fcall_cache;
+
+       if (!name_length || !name) {
+               return FAILURE;
+       }

        lc_name = do_alloca(name_length + 1);
        zend_str_tolower_copy(lc_name, name, name_length);
 [2004-11-17 13:40 UTC] stas@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC