php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2812 Crash in function_exists()
Submitted: 1999-11-24 01:53 UTC Modified: 1999-11-24 10:36 UTC
From: christophe dot massiot at mail dot dotcom dot fr Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.12 OS: Debian slink/Linux 2.2.12
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: christophe dot massiot at mail dot dotcom dot fr
New email:
PHP Version: OS:

 

 [1999-11-24 01:53 UTC] christophe dot massiot at mail dot dotcom dot fr
The following script :

<?
class toto {
  function titi() { }
}
$toto = new toto;
echo function_exists($toto->titi);
?>

generates a segmentation fault with the following backtrace :

Program received signal SIGSEGV, Segmentation fault.
0x8060a38 in _estrdup (s=0x0) at alloc.c:267
267             length = strlen(s)+1;
(gdb) bt
#0  0x8060a38 in _estrdup (s=0x0) at alloc.c:267
#1  0x8067b6c in php3_function_exists (ht=0x80da418, return_value=0x80b133c, 
    list=0x80c2380, plist=0x80c2340) at functions/basic_functions.c:2063
#2  0x80506b3 in phpparse () at control_structures_inline.h:934
#3  0x8059cc8 in php3_parse (yyin=0x80d3f20) at main.c:1553
#4  0x805a302 in main (argc=2, argv=0xbffff9a4) at main.c:1862

OK, I know it shouldn't do what I expect anyway, but it crashes...

NB : the bug doesn't occur under PHP4b3.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-24 10:36 UTC] thies at cvs dot php dot net
fixed in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 06:01:34 2025 UTC