|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-09-25 02:06 UTC] 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 10:00:01 2025 UTC |
Sure - this will result in a segfault. int register_moules(sapi_module_struct* sapi_module) { zend_module_entry modules[] = { my_module_1_entry, my_module_2_entry, }; int module_count = sizeof(modules) / sizeof(zend_module_entry); return php_module_startup(sapi_module, modules, module_count); }