sas             Thu Apr  3 13:09:41 2003 EDT

  Modified files:              
    /php4/ext/standard  basic_functions.c 
  Log:
  Prevent entering of anything but arrays/strings in register_shutdown_func
  
  Noticed by: Jan Schneider
  
  
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.603 
php4/ext/standard/basic_functions.c:1.604
--- php4/ext/standard/basic_functions.c:1.603   Wed Apr  2 20:12:47 2003
+++ php4/ext/standard/basic_functions.c Thu Apr  3 13:09:41 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.603 2003/04/03 01:12:47 sniper Exp $ */
+/* $Id: basic_functions.c,v 1.604 2003/04/03 18:09:41 sas Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -2173,7 +2173,12 @@
        if (zend_get_parameters_array(ht, shutdown_function_entry.arg_count, 
shutdown_function_entry.arguments) == FAILURE) {
                RETURN_FALSE;
        }
-       convert_to_string(shutdown_function_entry.arguments[0]);
+       
+       /* Prevent entering of anything but arrays/strings */
+       if (Z_TYPE_P(shutdown_function_entry.arguments[0]) != IS_ARRAY) {
+               convert_to_string(shutdown_function_entry.arguments[0]);
+       }
+       
        if (!BG(user_shutdown_function_names)) {
                ALLOC_HASHTABLE(BG(user_shutdown_function_names));
                zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void 
(*)(void *)) user_shutdown_function_dtor, 0);



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

Reply via email to