summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Guay <nguay@redhat.com>2012-07-18 11:55:35 -0400
committerJakub Hrozek <jhrozek@redhat.com>2012-07-18 20:07:45 +0200
commit8bbf89c5ab798c112773fe23515c3a9df56dde71 (patch)
treed25ac1f047e70fd01d4c636d9cc743ffeddaa0e9
parentcd52ba11971c5bbfd2fdfc114b0f1c66caa512bf (diff)
downloadsssd-8bbf89c5ab798c112773fe23515c3a9df56dde71.tar.gz
sssd-8bbf89c5ab798c112773fe23515c3a9df56dde71.tar.xz
sssd-8bbf89c5ab798c112773fe23515c3a9df56dde71.zip
Fix uninitialized values
https://fedorahosted.org/sssd/ticket/1379
-rw-r--r--src/db/sysdb_selinux.c4
-rw-r--r--src/db/sysdb_sudo.c2
-rw-r--r--src/providers/ipa/ipa_session.c8
-rw-r--r--src/providers/krb5/krb5_child_handler.c2
-rw-r--r--src/providers/krb5/krb5_utils.c2
-rw-r--r--src/providers/ldap/sdap_async_connection.c2
-rw-r--r--src/providers/ldap/sdap_async_sudo.c2
-rw-r--r--src/providers/ldap/sdap_sudo.c12
-rw-r--r--src/responder/nss/nsssrv_services.c6
-rw-r--r--src/responder/pam/pamsrv_cmd.c2
-rw-r--r--src/responder/sudo/sudosrv_dp.c2
-rw-r--r--src/sss_client/common.c2
12 files changed, 23 insertions, 23 deletions
diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index 5311545da..1b020b772 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -126,10 +126,10 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb,
struct ldb_message *msg;
struct ldb_message *rm_msg;
bool in_transaction = false;
- const char *objectclass;
+ const char *objectclass = NULL;
const char *name;
char *clean_name;
- struct ldb_dn *dn;
+ struct ldb_dn *dn = NULL;
errno_t sret = EOK;
errno_t ret;
time_t now;
diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c
index be7df6512..be101d8b3 100644
--- a/src/db/sysdb_sudo.c
+++ b/src/db/sysdb_sudo.c
@@ -294,7 +294,7 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, const char *username,
struct ldb_message *msg;
char **sysdb_groupnames = NULL;
struct ldb_message_element *groups;
- uid_t uid;
+ uid_t uid = 0;
int i;
tmp_ctx = talloc_new(NULL);
diff --git a/src/providers/ipa/ipa_session.c b/src/providers/ipa/ipa_session.c
index 38f0acd74..3a87e957c 100644
--- a/src/providers/ipa/ipa_session.c
+++ b/src/providers/ipa/ipa_session.c
@@ -102,12 +102,12 @@ static void ipa_session_handler_done(struct tevent_req *req)
struct be_req *breq = tevent_req_callback_data(req, struct be_req);
struct sysdb_ctx *sysdb = breq->be_ctx->sysdb;
errno_t ret, sret;
- size_t map_count;
- struct sysdb_attrs **maps;
+ size_t map_count = 0;
+ struct sysdb_attrs **maps = NULL;
bool in_transaction = false;
- char *default_user;
+ char *default_user = NULL;
struct pam_data *pd = talloc_get_type(breq->req_data, struct pam_data);
- char *map_order;
+ char *map_order = NULL;
ret = ipa_get_selinux_recv(req, breq, &map_count, &maps,
&default_user, &map_order);
diff --git a/src/providers/krb5/krb5_child_handler.c b/src/providers/krb5/krb5_child_handler.c
index 0526ff019..768d8c7dc 100644
--- a/src/providers/krb5/krb5_child_handler.c
+++ b/src/providers/krb5/krb5_child_handler.c
@@ -92,7 +92,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
size_t rp;
const char *keytab;
uint32_t validate;
- size_t username_len;
+ size_t username_len = 0;
keytab = dp_opt_get_cstring(kr->krb5_ctx->opts, KRB5_KEYTAB);
if (keytab == NULL) {
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index ceadcd582..f92a2cc6d 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -578,7 +578,7 @@ done:
struct sss_krb5_cc_be *
get_cc_be_ops(enum sss_krb5_cc_type type)
{
- struct sss_krb5_cc_be *be;
+ struct sss_krb5_cc_be *be = NULL;
switch (type) {
case SSS_KRB5_TYPE_FILE:
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 65bc667b9..d7beaa806 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -1310,7 +1310,7 @@ static void sdap_cli_resolve_done(struct tevent_req *subreq)
struct sdap_cli_connect_state *state = tevent_req_data(req,
struct sdap_cli_connect_state);
int ret;
- bool use_tls;
+ bool use_tls = true;
switch (state->force_tls) {
case CON_TLS_DFL:
diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c
index 92200aa77..db5e056d9 100644
--- a/src/providers/ldap/sdap_async_sudo.c
+++ b/src/providers/ldap/sdap_async_sudo.c
@@ -460,7 +460,7 @@ static void sdap_sudo_load_sudoers_done(struct tevent_req *subreq)
struct tevent_req *req = NULL; /* req from sdap_sudo_refresh_send() */
struct sdap_sudo_refresh_state *state = NULL;
struct sysdb_attrs **rules = NULL;
- size_t rules_count;
+ size_t rules_count = 0;
int ret;
errno_t sret;
bool in_transaction = false;
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c
index 0d5900230..cd3435b80 100644
--- a/src/providers/ldap/sdap_sudo.c
+++ b/src/providers/ldap/sdap_sudo.c
@@ -437,8 +437,8 @@ static void sdap_sudo_reply(struct tevent_req *req)
{
struct be_req *be_req = NULL;
struct be_sudo_req *sudo_req = NULL;
- int dp_error;
- int error;
+ int dp_error = DP_ERR_OK;
+ int error = EOK;
int ret;
be_req = tevent_req_callback_data(req, struct be_req);
@@ -926,8 +926,8 @@ static void sdap_sudo_periodical_first_refresh_done(struct tevent_req *req)
struct tevent_req *subreq = NULL; /* req from sdap_sudo_full_refresh_send() */
struct sdap_sudo_ctx *sudo_ctx = NULL;
time_t delay;
- int dp_error;
- int error;
+ int dp_error = DP_ERR_OK;
+ int error = EOK;
int ret;
ret = sdap_sudo_timer_recv(req, req, &subreq);
@@ -985,8 +985,8 @@ static void sdap_sudo_periodical_full_refresh_done(struct tevent_req *req)
struct tevent_req *subreq = NULL; /* req from sdap_sudo_full_refresh_send() */
struct sdap_sudo_ctx *sudo_ctx = NULL;
time_t delay;
- int dp_error;
- int error;
+ int dp_error = DP_ERR_OK;
+ int error = EOK;
int ret;
ret = sdap_sudo_timer_recv(req, req, &subreq);
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index e0ee21c30..906982317 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -597,7 +597,8 @@ fill_service(struct sss_packet *packet,
errno_t ret;
unsigned int msg_count = *count;
size_t rzero, rsize, aptr;
- unsigned int num, i, j;
+ unsigned int num = 0;
+ unsigned int i, j;
uint32_t num_aliases, written_aliases;
struct ldb_message *msg;
struct ldb_message_element *el;
@@ -623,7 +624,6 @@ fill_service(struct sss_packet *packet,
rzero = 2 * sizeof(uint32_t);
rsize = 0;
- num = 0;
for (i = 0; i < msg_count; i++) {
talloc_zfree(tmp_ctx);
tmp_ctx = talloc_new(NULL);
@@ -1472,7 +1472,7 @@ static void
setservent_step_done(struct tevent_req *req)
{
errno_t ret;
- struct ldb_result *res;
+ struct ldb_result *res = NULL;
struct setent_step_ctx *step_ctx =
tevent_req_callback_data(req, struct setent_step_ctx);
struct nss_dom_ctx *dctx = step_ctx->dctx;
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 20de738fc..e66debe24 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -368,7 +368,7 @@ static errno_t get_selinux_string(struct pam_auth_req *preq)
errno_t ret;
int i, j;
size_t order_count;
- size_t len;
+ size_t len = 0;
tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) {
diff --git a/src/responder/sudo/sudosrv_dp.c b/src/responder/sudo/sudosrv_dp.c
index 2063b2911..208606c26 100644
--- a/src/responder/sudo/sudosrv_dp.c
+++ b/src/responder/sudo/sudosrv_dp.c
@@ -58,7 +58,7 @@ sss_dp_get_sudoers_send(TALLOC_CTX *mem_ctx,
struct sss_dp_req_state *state;
struct sss_dp_get_sudoers_info *info;
errno_t ret;
- char *key;
+ char *key = NULL;
req = tevent_req_create(mem_ctx, &state, struct sss_dp_req_state);
if (!req) {
diff --git a/src/sss_client/common.c b/src/sss_client/common.c
index da7d1f95c..59eae3b1f 100644
--- a/src/sss_client/common.c
+++ b/src/sss_client/common.c
@@ -379,7 +379,7 @@ static enum sss_status sss_cli_make_request_nochecks(
static bool sss_cli_check_version(const char *socket_name)
{
- uint8_t *repbuf;
+ uint8_t *repbuf = NULL;
size_t replen;
enum sss_status nret;
int errnop;