mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix some MSAN complaints under Clang (#8553)
This commit is contained in:
committed by
GitHub
parent
cd6ae60d48
commit
926407f224
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -505,7 +505,7 @@ no_results:
|
||||
* 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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user