]> granicus.if.org Git - php/commitdiff
Prevent entering of anything but arrays/strings in register_shutdown_func
authorSascha Schumann <sas@php.net>
Thu, 3 Apr 2003 18:09:41 +0000 (18:09 +0000)
committerSascha Schumann <sas@php.net>
Thu, 3 Apr 2003 18:09:41 +0000 (18:09 +0000)
Noticed by: Jan Schneider

ext/standard/basic_functions.c

index e81446dc60b90718a5c44a2e4966e2f36d8a33d7..9ae0e20a857ca036ec9de36b5a6b6bbcfe6fcd47 100644 (file)
@@ -2173,7 +2173,12 @@ PHP_FUNCTION(register_shutdown_function)
        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);