diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index ae2c734b09b4e..8e11841ad2658 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -39,7 +39,7 @@ static void zend_stream_stdio_closer(void *handle) /* {{{ */ static size_t zend_stream_stdio_fsizer(void *handle) /* {{{ */ { - zend_stat_t buf; + zend_stat_t buf = {0}; if (handle && zend_fstat(fileno((FILE*)handle), &buf) == 0) { #ifdef S_ISREG if (!S_ISREG(buf.st_mode)) { diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index d8a9046d04d8b..404a5cfea4c33 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -502,7 +502,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim do { free(pathw); } while(0); #else - zend_stat_t st; + zend_stat_t st = {0}; #endif realpath_cache_bucket *bucket; char *tmp; diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 2f4502cd116a1..8ed0caae85ee7 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -994,7 +994,7 @@ static accel_time_t zend_get_file_handle_timestamp_win(zend_file_handle *file_ha accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size) { - zend_stat_t statbuf; + zend_stat_t statbuf = {0}; #ifdef ZEND_WIN32 accel_time_t res; #endif diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index b09eb9ff41ad9..5bdfe7a373a73 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -134,7 +134,7 @@ static ZEND_INI_MH(OnUpdateFileCache) if (!ZSTR_LEN(new_value)) { new_value = NULL; } else { - zend_stat_t buf; + zend_stat_t buf = {0}; if (!IS_ABSOLUTE_PATH(ZSTR_VAL(new_value), ZSTR_LEN(new_value)) || zend_stat(ZSTR_VAL(new_value), &buf) != 0 || diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 8f2ddf742b679..8681c3113193b 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -505,7 +505,7 @@ PHP_FUNCTION(glob) * able to filter directories out. */ if (flags & GLOB_ONLYDIR) { - zend_stat_t s; + zend_stat_t s = {0}; if (0 != VCWD_STAT(globbuf.gl_pathv[n], &s)) { continue; diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 01d97ce0c4e7b..ba147e353e3ef 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -384,7 +384,7 @@ static void _php_dns_free_res(struct __res_state *res) { /* {{{ */ PHP_FUNCTION(dns_check_record) { HEADER *hp; - querybuf answer; + querybuf answer = {0}; char *hostname; size_t hostname_len; zend_string *rectype = NULL; @@ -470,7 +470,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t long n, i; u_short s; u_char *tp, *p; - char name[MAXHOSTNAMELEN]; + char name[MAXHOSTNAMELEN] = {0}; int have_v6_break = 0, in_v6_break = 0; ZVAL_UNDEF(subarray); @@ -839,7 +839,7 @@ PHP_FUNCTION(dns_get_record) struct __res_state *handle = &state; #endif HEADER *hp; - querybuf answer; + querybuf answer = {0}; u_char *cp = NULL, *end = NULL; int n, qd, an, ns = 0, ar = 0; int type, first_query = 1, store_results = 1; @@ -1069,8 +1069,8 @@ PHP_FUNCTION(dns_get_mx) zval *mx_list, *weight_list = NULL; int count, qdc; u_short type, weight; - querybuf answer; - char buf[MAXHOSTNAMELEN]; + querybuf answer = {0}; + char buf[MAXHOSTNAMELEN] = {0}; HEADER *hp; u_char *cp, *end; int i; diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index a11ecf09f8f13..aaf7e730d0a54 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -740,8 +740,8 @@ PHP_FUNCTION(clearstatcache) /* {{{ php_stat */ PHPAPI void php_stat(zend_string *filename, int type, zval *return_value) { - zend_stat_t *stat_sb; - php_stream_statbuf ssb; + zend_stat_t *stat_sb = {0}; + php_stream_statbuf ssb = {0}; int flags = 0, rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to other */ const char *local = NULL; php_stream_wrapper *wrapper = NULL; diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index ce0f172426a3c..e4dd38637570a 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -178,7 +178,7 @@ PHP_FUNCTION(iptcembed) size_t inx; zend_string *spoolbuf = NULL; unsigned char *poi = NULL; - zend_stat_t sb; + zend_stat_t sb = {0}; bool written = 0; ZEND_PARSE_PARAMETERS_START(2, 3) diff --git a/ext/standard/link.c b/ext/standard/link.c index 2f29b5bcc0288..c63f7ff268343 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -94,7 +94,7 @@ PHP_FUNCTION(linkinfo) char *link; char *dirname; size_t link_len; - zend_stat_t sb; + zend_stat_t sb = {0}; int ret; ZEND_PARSE_PARAMETERS_START(1, 1) diff --git a/main/php_ini.c b/main/php_ini.c index d080163663851..0f3fdcd502fb4 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -566,7 +566,7 @@ int php_init_config(void) /* Check if php_ini_file_name is a file and can be opened */ if (php_ini_file_name && php_ini_file_name[0]) { - zend_stat_t statbuf; + zend_stat_t statbuf = {0}; if (!VCWD_STAT(php_ini_file_name, &statbuf)) { if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { @@ -642,7 +642,7 @@ int php_init_config(void) if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) { struct dirent **namelist; int ndir, i; - zend_stat_t sb; + zend_stat_t sb = {0}; char ini_file[MAXPATHLEN]; char *p; zend_llist scanned_ini_list;