On Sun, Apr 20, 2008 at 5:07 PM, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote:
> iliaa           Sun Apr 20 15:07:39 2008 UTC
>
>   Modified files:              (Branch: PHP_5_3)
>     /php-src/ext/standard       basic_functions.c
>   Log:
>   Fixed a bug #44403 (register_tick_function() does not check for a valid 
> callback)
>
>
>  
> http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.27&r2=1.725.2.31.2.64.2.28&diff_format=u
>  Index: php-src/ext/standard/basic_functions.c
>  diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.27 
> php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.28
>  --- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.27 Tue Apr 15 
> 09:02:40 2008
>  +++ php-src/ext/standard/basic_functions.c      Sun Apr 20 15:07:39 2008
>  @@ -18,7 +18,7 @@
>     +----------------------------------------------------------------------+
>   */
>
>  -/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.27 2008/04/15 09:02:40 jani 
> Exp $ */
>  +/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.28 2008/04/20 15:07:39 iliaa 
> Exp $ */
>
>   #include "php.h"
>   #include "php_streams.h"
>  @@ -6045,6 +6045,7 @@
>   {
>         user_tick_function_entry tick_fe;
>         int i;
>  +       char *function_name = NULL;
>
>         tick_fe.calling = 0;
>         tick_fe.arg_count = ZEND_NUM_ARGS();
>  @@ -6060,6 +6061,13 @@
>                 RETURN_FALSE;
>         }
>
>  +       if (!zend_is_callable(tick_fe.arguments[0], 0, &function_name)) {
>  +         efree(tick_fe.arguments);
>  +         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown 
> callback '%s' passed", function_name);

Copy&paste typo? (shouldn't it say "Invalid tick callback?")

>  +         efree(function_name);
>  +         RETURN_FALSE;
>  +       }
>  +

Didn't you forget to free function_name on success?

-Hannes

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to