Bug #63159 [Opn]: Passing > 1 additional module to php_module_startup causes a segfault
| From: | laruence@php.net | Date: | Tue, 25 Sep 2012 09:42:22 +0000 |
| Subject: | Bug #63159 [Opn]: Passing > 1 additional module to php_module_startup causes a segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173702@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63159&edit=1
ID: 63159
Updated by: laruence@php.net
Reported by: slangley at google dot com
Summary: Passing > 1 additional module to php_module_startup
causes a segfault
Status: Open
Type: Bug
Package: Reproducible crash
Operating System: N/A
PHP Version: 5.4.7
Block user comment: N
Private report: N
New Comment:
I am not sure, is this just a wrong usage of ZEND API?
Previous Comments:
------------------------------------------------------------------------
[2012-09-25 02:06:43] slangley at google dot com
Description:
------------
This was reported in 2004 but seemingly never fixed?
http://marc.info/?l=php-internals&m=110257814320454&w=2
php_module_startup expects a pointer to an array of structures of
zend_module_entry. This gets passed to php_register_extensions which expects an
array of points to structures of zend_module_entry. php_register_extensions then
tries to use pointer arithmetic to walk along the passed array, which will cause a
seg fault.
I will make a pull request on github with this fix.
Test script:
---------------
Write a SAPI, pass > 2 additional modules to php_module_startup.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63159&edit=1