if (r <= 0 || r >= sizeof buf)
if (r <= 0 || r >= (int)sizeof(buf))
int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,				       const char *dir)	{	DIR *d;	struct dirent *dstruct;	int ret = 0;	CRYPTO_w_lock(CRYPTO_LOCK_READDIR);	d = opendir(dir);	/* Note that a side effect is that the CAs will be sorted by name */	if(!d)		{		SYSerr(SYS_F_OPENDIR, get_last_sys_error());		ERR_add_error_data(3, "opendir('", dir, "')");		SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB);		goto err;		}		while((dstruct=readdir(d)))		{		char buf[1024];		int r;				if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf)			{			SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG);			goto err;			}				r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name);		if (r <= 0 || r >= sizeof buf)			goto err;		if(!SSL_add_file_cert_subjects_to_stack(stack,buf))			goto err;		}	ret = 1;err:		if (d) closedir(d);	CRYPTO_w_unlock(CRYPTO_LOCK_READDIR);	return ret;	}