mirror of
https://github.com/samba-team/samba.git
synced 2025-11-27 08:23:49 +03:00
r4037: fixed a bunch of "might be uninitialised" warnings after enabling -O1 in my compile
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
f572fe6d29
commit
0928b1f5b6
@@ -500,7 +500,7 @@ NTSTATUS make_server_info_netlogon_validation(TALLOC_CTX *mem_ctx,
|
||||
union netr_Validation *validation)
|
||||
{
|
||||
NTSTATUS nt_status;
|
||||
struct netr_SamBaseInfo *base;
|
||||
struct netr_SamBaseInfo *base = NULL;
|
||||
switch (validation_level) {
|
||||
case 2:
|
||||
if (!validation || !validation->sam2) {
|
||||
@@ -520,6 +520,8 @@ NTSTATUS make_server_info_netlogon_validation(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
base = &validation->sam6->base;
|
||||
break;
|
||||
default:
|
||||
return NT_STATUS_INVALID_LEVEL;
|
||||
}
|
||||
|
||||
nt_status = make_server_info(mem_ctx, server_info, internal_username);
|
||||
|
||||
@@ -2671,7 +2671,7 @@ static char **completion_fn(const char *text, int start, int end)
|
||||
return NULL;
|
||||
} else {
|
||||
char **matches;
|
||||
int i, len, samelen, count=1;
|
||||
int i, len, samelen = 0, count=1;
|
||||
|
||||
matches = (char **)malloc(sizeof(matches[0])*MAX_COMPLETIONS);
|
||||
if (!matches) return NULL;
|
||||
|
||||
@@ -59,7 +59,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
|
||||
int result = LDAP_SUCCESS;
|
||||
struct samdb_context *samdb;
|
||||
struct ldb_message **res;
|
||||
int i, j, y, count;
|
||||
int i, j, y, count = 0;
|
||||
enum ldb_scope scope = LDB_SCOPE_DEFAULT;
|
||||
const char **attrs = NULL;
|
||||
const char *errstr = NULL;
|
||||
@@ -183,7 +183,7 @@ static NTSTATUS sldb_Add(struct ldapsrv_partition *partition, struct ldapsrv_cal
|
||||
struct ldapsrv_reply *add_reply;
|
||||
int ldb_ret;
|
||||
struct samdb_context *samdb;
|
||||
struct ldb_message *msg;
|
||||
struct ldb_message *msg = NULL;
|
||||
int result = LDAP_SUCCESS;
|
||||
const char *errstr = NULL;
|
||||
int i,j;
|
||||
@@ -336,7 +336,7 @@ static NTSTATUS sldb_Modify(struct ldapsrv_partition *partition, struct ldapsrv_
|
||||
struct ldapsrv_reply *modify_reply;
|
||||
int ldb_ret;
|
||||
struct samdb_context *samdb;
|
||||
struct ldb_message *msg;
|
||||
struct ldb_message *msg = NULL;
|
||||
int result = LDAP_SUCCESS;
|
||||
const char *errstr = NULL;
|
||||
int i,j;
|
||||
@@ -450,7 +450,7 @@ static NTSTATUS sldb_Compare(struct ldapsrv_partition *partition, struct ldapsrv
|
||||
struct ldb_message **res;
|
||||
const char *attrs[1];
|
||||
const char *errstr = NULL;
|
||||
const char *filter;
|
||||
const char *filter = NULL;
|
||||
int count;
|
||||
|
||||
local_ctx = talloc_named(call, 0, "sldb_Compare local_memory_context");
|
||||
@@ -517,7 +517,7 @@ NTSTATUS sldb_ModifyDN(struct ldapsrv_partition *partition, struct ldapsrv_call
|
||||
struct samdb_context *samdb;
|
||||
const char *errstr = NULL;
|
||||
int result = LDAP_SUCCESS;
|
||||
const char *newdn;
|
||||
const char *newdn = NULL;
|
||||
char *parentdn = NULL;
|
||||
|
||||
local_ctx = talloc_named(call, 0, "sldb_ModifyDN local memory context");
|
||||
|
||||
@@ -209,7 +209,7 @@ static WERROR dcom_create_object_remote(struct dcom_context *ctx, struct GUID *c
|
||||
|
||||
WERROR dcom_create_object(struct dcom_context *ctx, struct GUID *clsid, const char *server, int num_ifaces, struct GUID *iid, struct dcom_interface_p ***ip, WERROR *results)
|
||||
{
|
||||
struct dcom_interface_p *factory, *iunk;
|
||||
struct dcom_interface_p *factory, *iunk = NULL;
|
||||
struct QueryInterface qr;
|
||||
struct Release rr;
|
||||
struct CreateInstance cr;
|
||||
|
||||
@@ -614,7 +614,7 @@ WERROR reg_key_get_parent(TALLOC_CTX *mem_ctx, struct registry_key *key, struct
|
||||
{
|
||||
char *parent_name;
|
||||
char *last;
|
||||
struct registry_key *root;
|
||||
struct registry_key *root = NULL;
|
||||
WERROR error;
|
||||
|
||||
parent_name = strdup(key->path);
|
||||
|
||||
@@ -320,7 +320,7 @@ static WERROR w95_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *k, i
|
||||
DWORD i;
|
||||
DWORD offset = 0;
|
||||
RGDB_KEY *rgdb_key = LOCN_RGDB_KEY((CREG *)k->hive->backend_data, rgkn_key->id.rgdb, rgkn_key->id.id);
|
||||
RGDB_VALUE *curval;
|
||||
RGDB_VALUE *curval = NULL;
|
||||
|
||||
if(!rgdb_key) return WERR_FOOBAR;
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ static char **reg_complete_command(const char *text, int end)
|
||||
{
|
||||
/* Complete command */
|
||||
char **matches;
|
||||
int i, len, samelen, count=1;
|
||||
int i, len, samelen=0, count=1;
|
||||
|
||||
matches = (char **)malloc(sizeof(matches[0])*MAX_COMPLETIONS);
|
||||
if (!matches) return NULL;
|
||||
|
||||
@@ -368,6 +368,8 @@ NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state)
|
||||
recv_sign_const = CLI_SIGN;
|
||||
recv_seal_const = CLI_SEAL;
|
||||
break;
|
||||
default:
|
||||
return NT_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -393,7 +393,7 @@ static NTSTATUS smb_raw_session_setup_generic_spnego(struct smbcli_session *sess
|
||||
union smb_sesssetup s2;
|
||||
DATA_BLOB session_key = data_blob(NULL, 0);
|
||||
DATA_BLOB null_data_blob = data_blob(NULL, 0);
|
||||
const char *chosen_oid;
|
||||
const char *chosen_oid = NULL;
|
||||
|
||||
s2.generic.level = RAW_SESSSETUP_SPNEGO;
|
||||
s2.spnego.in.bufsize = session->transport->options.max_xmit;
|
||||
|
||||
@@ -602,7 +602,7 @@ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, struct epm_tower *tower,
|
||||
|
||||
NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, struct dcerpc_binding *binding, struct epm_tower *tower)
|
||||
{
|
||||
const enum epm_protocols *protseq;
|
||||
const enum epm_protocols *protseq = NULL;
|
||||
int num_protocols = -1, i;
|
||||
NTSTATUS status;
|
||||
|
||||
|
||||
@@ -546,8 +546,8 @@ NTSTATUS pvfs_resolve_partial(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
|
||||
NTSTATUS pvfs_resolve_name_fd(struct pvfs_state *pvfs, int fd,
|
||||
struct pvfs_filename *name)
|
||||
{
|
||||
dev_t device;
|
||||
ino_t inode;
|
||||
dev_t device = 0;
|
||||
ino_t inode = 0;
|
||||
|
||||
if (name->exists) {
|
||||
device = name->st.st_dev;
|
||||
|
||||
@@ -37,9 +37,9 @@ struct dcom_interface_pointer *dcom_interface_pointer_by_ipid(struct GUID *ipid)
|
||||
*/
|
||||
static WERROR RemoteActivation(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct RemoteActivation *r)
|
||||
{
|
||||
struct CreateInstance *cr;
|
||||
struct CreateInstance *cr = NULL;
|
||||
/*struct Release *ur;*/
|
||||
struct dcom_interface_p *o;
|
||||
struct dcom_interface_p *o = NULL;
|
||||
int i;
|
||||
|
||||
/* FIXME: CoGetClassObject() */
|
||||
|
||||
@@ -1968,7 +1968,7 @@ BOOL torture_denydos_sharing(void)
|
||||
union smb_fileinfo finfo;
|
||||
const char *fname = "\\torture_denydos.txt";
|
||||
NTSTATUS status;
|
||||
int fnum1, fnum2;
|
||||
int fnum1 = -1, fnum2 = -1;
|
||||
BOOL ret = True;
|
||||
union smb_setfileinfo sfinfo;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
|
||||
@@ -790,7 +790,7 @@ BOOL torture_locktest7(void)
|
||||
struct smbcli_state *cli1;
|
||||
const char *fname = "\\lockt7.lck";
|
||||
int fnum1;
|
||||
int fnum2;
|
||||
int fnum2 = -1;
|
||||
size_t size;
|
||||
char buf[200];
|
||||
BOOL correct = False;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
BOOL torture_dcom_simple(void)
|
||||
{
|
||||
NTSTATUS status;
|
||||
struct dcerpc_pipe *p;
|
||||
struct dcerpc_pipe *p = NULL;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
BOOL ret = True;
|
||||
struct GUID IID[2];
|
||||
|
||||
@@ -41,7 +41,7 @@ static BOOL test_sd(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
union smb_open io;
|
||||
const char *fname = BASEDIR "\\sd.txt";
|
||||
BOOL ret = True;
|
||||
int fnum;
|
||||
int fnum = -1;
|
||||
union smb_fileinfo q;
|
||||
union smb_setfileinfo set;
|
||||
struct security_ace ace;
|
||||
@@ -249,7 +249,7 @@ static BOOL test_creator_sid(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
union smb_open io;
|
||||
const char *fname = BASEDIR "\\creator.txt";
|
||||
BOOL ret = True;
|
||||
int fnum;
|
||||
int fnum = -1;
|
||||
union smb_fileinfo q;
|
||||
union smb_setfileinfo set;
|
||||
struct security_descriptor *sd, *sd_orig, *sd2;
|
||||
@@ -323,7 +323,7 @@ static BOOL test_creator_sid(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
|
||||
printf("set a sec desc allowing no write by owner\n");
|
||||
sd = security_descriptor_create(mem_ctx,
|
||||
NULL, NULL,
|
||||
owner_sid, NULL,
|
||||
owner_sid,
|
||||
SEC_ACE_TYPE_ACCESS_ALLOWED,
|
||||
SEC_RIGHTS_FILE_READ | SEC_STD_ALL,
|
||||
@@ -440,7 +440,7 @@ static BOOL test_generic_bits(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
union smb_open io;
|
||||
const char *fname = BASEDIR "\\generic.txt";
|
||||
BOOL ret = True;
|
||||
int fnum, i;
|
||||
int fnum = -1, i;
|
||||
union smb_fileinfo q;
|
||||
union smb_setfileinfo set;
|
||||
struct security_descriptor *sd, *sd_orig, *sd2;
|
||||
|
||||
@@ -99,7 +99,7 @@ static BOOL test_eas(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
union smb_open io;
|
||||
const char *fname = BASEDIR "\\ea.txt";
|
||||
BOOL ret = True;
|
||||
int fnum;
|
||||
int fnum = -1;
|
||||
|
||||
printf("TESTING SETFILEINFO EA_SET\n");
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ static BOOL test_mv(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
union smb_rename io;
|
||||
NTSTATUS status;
|
||||
BOOL ret = True;
|
||||
int fnum;
|
||||
int fnum = -1;
|
||||
const char *fname1 = BASEDIR "\\test1.txt";
|
||||
const char *fname2 = BASEDIR "\\test2.txt";
|
||||
union smb_open op;
|
||||
|
||||
@@ -99,7 +99,7 @@ static BOOL test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
|
||||
const char *fname = BASEDIR "\\stream.txt";
|
||||
const char *sname1, *sname2;
|
||||
BOOL ret = True;
|
||||
int fnum;
|
||||
int fnum = -1;
|
||||
ssize_t retsize;
|
||||
|
||||
sname1 = talloc_asprintf(mem_ctx, "%s:%s", fname, "Stream One");
|
||||
|
||||
@@ -72,10 +72,8 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
|
||||
struct netr_LogonSamLogonEx *r_ex = &samlogon_state->r_ex;
|
||||
struct netr_LogonSamLogonWithFlags *r_flags = &samlogon_state->r_flags;
|
||||
struct netr_NetworkInfo ninfo;
|
||||
|
||||
struct netr_SamBaseInfo *base;
|
||||
|
||||
uint16 validation_level;
|
||||
struct netr_SamBaseInfo *base = NULL;
|
||||
uint16 validation_level = 0;
|
||||
|
||||
samlogon_state->r.in.logon.network = &ninfo;
|
||||
samlogon_state->r_ex.in.logon.network = &ninfo;
|
||||
|
||||
@@ -775,7 +775,7 @@ static NTSTATUS test_getallsids(struct smbcli_transport *transport,
|
||||
struct samr_Connect4 r4;
|
||||
struct policy_handle connect_handle, user_handle;
|
||||
struct policy_handle builtin_handle, domain_handle;
|
||||
struct dom_sid *domain_sid;
|
||||
struct dom_sid *domain_sid = NULL;
|
||||
|
||||
struct dom_sid *user_sid;
|
||||
struct dom_sid *primary_group_sid;
|
||||
|
||||
@@ -159,7 +159,7 @@ static int binary_net(int argc, const char **argv)
|
||||
int argc_new;
|
||||
const char **argv_new;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
struct net_context *ctx;
|
||||
struct net_context *ctx = NULL;
|
||||
poptContext pc;
|
||||
struct poptOption long_options[] = {
|
||||
POPT_AUTOHELP
|
||||
|
||||
Reference in New Issue
Block a user