cellog Thu Jun 12 18:46:58 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/phar func_interceptors.c Log: ensure we don't try to use an unitialized hash table http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.20.2.2&r2=1.20.2.3&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.20.2.2 php-src/ext/phar/func_interceptors.c:1.20.2.3 --- php-src/ext/phar/func_interceptors.c:1.20.2.2 Thu Jun 12 04:57:24 2008 +++ php-src/ext/phar/func_interceptors.c Thu Jun 12 18:46:58 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: func_interceptors.c,v 1.20.2.2 2008/06/12 04:57:24 cellog Exp $ */ +/* $Id: func_interceptors.c,v 1.20.2.3 2008/06/12 18:46:58 cellog Exp $ */ #include "phar_internal.h" @@ -29,7 +29,7 @@ int filename_len; zval *zcontext = NULL; - if (!zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { + if (!PHAR_GLOBALS->phar_fname_map.arBuckets || !zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { goto skip_phar; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &filename, &filename_len, &zcontext) == FAILURE) { @@ -97,7 +97,7 @@ long maxlen = PHP_STREAM_COPY_ALL; zval *zcontext = NULL; - if (!zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { + if (!PHAR_GLOBALS->phar_fname_map.arBuckets || !zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { goto skip_phar; } /* Parse arguments */ @@ -222,7 +222,7 @@ zval *zcontext = NULL; php_stream *stream; - if (!zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { + if (!PHAR_GLOBALS->phar_fname_map.arBuckets || !zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { goto skip_phar; } if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) { @@ -312,7 +312,7 @@ zval *zcontext = NULL; php_stream *stream; - if (!zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { + if (!PHAR_GLOBALS->phar_fname_map.arBuckets || !zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { /* no need to check, include_path not even specified in fopen/ no active phars */ goto skip_phar; } @@ -869,7 +869,7 @@ char *filename; int filename_len; - if (!zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { + if (!PHAR_GLOBALS->phar_fname_map.arBuckets || !zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { goto skip_phar; } if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { @@ -929,7 +929,7 @@ char *filename; int filename_len; - if (!zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { + if (!PHAR_GLOBALS->phar_fname_map.arBuckets || !zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { goto skip_phar; } if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php