On Fri, Nov 11, 2011 at 12:17 AM, Rasmus Lerdorf <ras...@lerdorf.com> wrote:

> Hey Arpad, looking through the code you added to
> ext/standard/basic_functions.c it looks like you are doing some weird
> key handling in the shutdown function hash.
>
>
Hi Rasmus,

Thanks for the heads up, just fixed these.

Cheers,

Arpad



> In register_user_shutdown_function() you have:
>
> zend_hash_update(BG(user_shutdown_function_names), function_name,
> sizeof(function_name), shutdown_function_entry,
> sizeof(php_shutdown_function_entry), NULL)
>
> And in remove_user_shutdown_function() you have:
>
> zend_hash_del_key_or_index(BG(user_shutdown_function_names),
> function_name, sizeof(function_name), 0, HASH_DEL_KEY)
>
> In both cases function_name is a char* so sizeof(function_name) is
> always going to be the size of a char* on whatever architecture you are
> on. But the way hash keys work, it is the actual string that is the key
> and you should be passing the length of that string here.
>
> -Rasmus
>

Reply via email to