php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59790 The filename buffer overflow --duplicated with #16965
Submitted: 2011-05-28 09:54 UTC Modified: 2011-05-29 11:01 UTC
From: zhihong dot chen dot cn at gmail dot com Assigned:
Status: Duplicate Package: bcompiler (PECL)
PHP Version: 5.3.6 OS: Ubuntu 8.04.4 LTS
Private report: No CVE-ID: None
 [2011-05-28 09:54 UTC] zhihong dot chen dot cn at gmail dot com
Description:
------------
I have result.php on 
/webserver/apps/kohana/modules/database/classes/kohana/datab
ase/postgresql/result.php. 
the compile this file, and run this file. Sometimes it 
segfalut. Somtimes the parent:: not found. The internal code 
broken a little. Even I set filename by 
bc_filename_call_back_handler when the file in 
/webserver/apps/kohana/modules/database/classes/kohana/datab
ase/postgresql/.  It is still broken.

When I copy result.php this file into /var/www/default, then 
compile this file and copy back to  
/webserver/apps/kohana/modules/database/classes/kohana/datab
ase/postgresql/result.php. All things works as expected.

I try a lot to reproduce this issue. Not easy then. I 
suppose that ,when files reside in a long directory name. 
The bytecode will overide something. And caused unexpected 
result.


Reproduce code:
---------------
I write some small code, but they work ok.Not easy to reproduce.

Expected result:
----------------
When directory is long, the compiled code still works Ok.
When change filename by bc_filename_call_back_handler, the 
generated code should be the same no matter where the realfile 
resides

Actual result:
--------------
When file reside in different directory, even set the filename 
as the same by bc_filename_call_back_handler, the generated 
code are still different.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-28 10:05 UTC] zhihong dot chen dot cn at gmail dot com
The first line of code is 
 class Kohana_Database_PostgreSQL_Result extends 
Database_Result.
But the error is:
Fatal error: Cannot access parent:: when current class scope 
has no parent
Which means that " extends Database_Result" is overided. Not 
only this file. A lot file occurs when their directory is 
similar long
 [2011-05-29 02:32 UTC] zhihong dot chen dot cn at gmail dot com
When I run another application, one of class cause SEGFAUTL on 
instanceof_function_ex which is call from 
zend_implement_serializable in zend_interface.c of PHP. This 
segfault could be described as sometimes, the compiled file 
will cause the parent:: search failed during the __construct 
of class failed or seg falut.
 [2011-05-29 02:56 UTC] zhihong dot chen dot cn at gmail dot com
It is the same bug as http://pecl.php.net/bugs/bug.php?
id=16965.

All seg fault code involve the extending the build in class.
I run the code post there, seg fault as well.
 [2011-05-29 03:04 UTC] zhihong dot chen dot cn at gmail dot com
My running environment is PHP-FPM 5.3.6.
 [2011-05-29 11:01 UTC] zhihong dot chen dot cn at gmail dot com
This is duplicated with #16965
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC