|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-05-22 14:54 UTC] krakjoe@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: krakjoe
[2021-05-22 14:54 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ prior to calling zend_hash_add, zend_register_functions translates the “key” to lowercase. Certainly there is nothing wrong with this approach, IF the corresponding code that searches for and removes the entry from the hash table is doing the same thing; otherwise, the hash codes will not match. (gdb) bt #0 _zend_hash_add_or_update (ht=0x8e827b0, arKey=0x8ef4be0 "initconnectapi", nKeyLength=15, pData=0x5e72c94, nDataSize=144, pDest=0x5e72c90, flag=2) at /nfs/local/src/php/php-5.3.2-1511_150610/Zend/zend_hash.c:208 #1 0x07a888fd in zend_register_functions (scope=0x0, functions=0x5db780, function_table=0x0, type=2, tsrm_ls=0x8e41038) at /nfs/local/src/php/php-5.3.2-1511_150610/Zend/zend_API.c:1930 #2 0x07a87ad9 in zend_register_module_ex (module=0x8f24c10, tsrm_ls=0x8e41038) at /nfs/local/src/php/php-5.3.2- that is: fname_len = strlen(ptr->fname); lowercase_name = zend_str_tolower_dup(ptr->fname, fname_len); if (zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)®_function) == FAILURE) { unload=1; efree(lowercase_name); break; } how the delete code does NOT translate the key to lowercase beforehand: (gdb) bt #0 zend_hash_del_key_or_index (ht=0x915b7b0, arKey=0x2d7d5a4 "initConnectAPI", nKeyLength=15, h=0, flag=0) at /nfs/local/src/php/php-5.3.2-1511_150610/Zend/zend_hash.c:462 #1 0x0058d205 in zend_unregister_functions (functions=0x2da6780, count=-1, function_table=0x0, tsrm_ls=0x911a038) at /nfs/local/src/php/php-5.3.2-1511_150610/Zend/zend_API.c:2091 #2 0x0058d3e4 in module_destructor (module=0x91fd9d0) at / Either both or neither should use 'tolower.'