diff options
author | Rich Megginson <rmeggins@redhat.com> | 2010-07-01 11:39:02 -0600 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2010-07-06 10:32:03 -0600 |
commit | 4a103859b7100bc30046ecba3efca2e8f0b09c7d (patch) | |
tree | c6e98af614c13e71852b1da536385220f9324934 /ldap | |
parent | 830d55e8cc9d4a69f099b1c0ee00a93817c8fabb (diff) | |
download | ds-4a103859b7100bc30046ecba3efca2e8f0b09c7d.tar.gz ds-4a103859b7100bc30046ecba3efca2e8f0b09c7d.tar.xz ds-4a103859b7100bc30046ecba3efca2e8f0b09c7d.zip |
Bug 610177 - fix coverity Defect Type: Uninitialized variables issues
https://bugzilla.redhat.com/show_bug.cgi?id=610177
Resolves: bug 610177
Bug Description: fix coverity Defect Type: Uninitialized variables issues
Reviewed by: nhosoi (Thanks!)
Branch: HEAD
Fix Description: Initialize variables to 0, NULL, or an appropriate error
code. Got rid of the unused lexer code.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
Diffstat (limited to 'ldap')
-rw-r--r-- | ldap/servers/plugins/bitwise/bitwise.c | 2 | ||||
-rw-r--r-- | ldap/servers/plugins/cos/cos_cache.c | 6 | ||||
-rw-r--r-- | ldap/servers/plugins/replication/repl5_connection.c | 2 | ||||
-rw-r--r-- | ldap/servers/plugins/replication/repl5_inc_protocol.c | 4 | ||||
-rw-r--r-- | ldap/servers/plugins/replication/windows_connection.c | 4 | ||||
-rw-r--r-- | ldap/servers/plugins/replication/windows_protocol_util.c | 2 | ||||
-rw-r--r-- | ldap/servers/plugins/views/views.c | 2 | ||||
-rw-r--r-- | ldap/servers/slapd/back-ldbm/idl.c | 2 | ||||
-rw-r--r-- | ldap/servers/slapd/backend_manager.c | 2 | ||||
-rw-r--r-- | ldap/servers/slapd/mapping_tree.c | 2 | ||||
-rw-r--r-- | ldap/servers/slapd/tools/ldclt/ldapfct.c | 2 |
11 files changed, 15 insertions, 15 deletions
diff --git a/ldap/servers/plugins/bitwise/bitwise.c b/ldap/servers/plugins/bitwise/bitwise.c index 01c05fd2..190e26df 100644 --- a/ldap/servers/plugins/bitwise/bitwise.c +++ b/ldap/servers/plugins/bitwise/bitwise.c @@ -123,7 +123,7 @@ internal_bitwise_filter_match(void* obj, Slapi_Entry* entry, Slapi_Attr* attr, i if (errno == ERANGE) { rc = LDAP_CONSTRAINT_VIOLATION; } else { - int result; + int result = 0; /* The Microsoft Windows AD bitwise operators do not work exactly as the plain old C bitwise operators work. For the AND case the matching rule is true only if all bits from the given value diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c index b5aace63..bc79ee5c 100644 --- a/ldap/servers/plugins/cos/cos_cache.c +++ b/ldap/servers/plugins/cos/cos_cache.c @@ -1101,7 +1101,7 @@ static int cos_dn_defs_cb (Slapi_Entry* e, void *callback_data) { static int cos_cache_add_dn_defs(char *dn, cosDefinitions **pDefs, int *vattr_cacheable) { Slapi_PBlock *pDnSearch = 0; - struct dn_defs_info info; + struct dn_defs_info info = {NULL, 0, 0}; pDnSearch = slapi_pblock_new(); if (pDnSearch) { info.ret=-1; /* assume no good defs */ @@ -1314,7 +1314,7 @@ static int cos_cache_add_dn_tmpls(char *dn, cosAttrValue *pCosSpecifier, cosAttr { void *plugin_id; int scope; - struct tmpl_info info; + struct tmpl_info info = {NULL, 0, 0}; Slapi_PBlock *pDnSearch = 0; LDAPDebug( LDAP_DEBUG_TRACE, "--> cos_cache_add_dn_tmpls\n",0,0,0); @@ -1714,7 +1714,7 @@ int cos_cache_getref(cos_cache **pptheCache) */ int cos_cache_addref(cos_cache *ptheCache) { - int ret; + int ret = 0; cosCache *pCache = (cosCache*)ptheCache; LDAPDebug( LDAP_DEBUG_TRACE, "--> cos_cache_addref\n",0,0,0); diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c index bd285184..aacdc557 100644 --- a/ldap/servers/plugins/replication/repl5_connection.c +++ b/ldap/servers/plugins/replication/repl5_connection.c @@ -639,7 +639,7 @@ perform_operation(Repl_Connection *conn, int optype, const char *dn, int deleteoldrdn, LDAPControl *update_control, const char *extop_oid, struct berval *extop_payload, int *message_id) { - int rc; + int rc = -1; ConnResult return_value = CONN_OPERATION_FAILED; LDAPControl *server_controls[3]; /* LDAPControl **loc_returned_controls; */ diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c index 6475eb89..e4c6e2bd 100644 --- a/ldap/servers/plugins/replication/repl5_inc_protocol.c +++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c @@ -1384,7 +1384,7 @@ reset_events (Private_Repl_Protocol *prp) ConnResult replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *message_id) { - ConnResult return_value; + ConnResult return_value = CONN_OPERATION_FAILED; LDAPControl *update_control; char *parentuniqueid; LDAPMod **modrdn_mods = NULL; @@ -2202,7 +2202,7 @@ examine_update_vector(Private_Repl_Protocol *prp, RUV *remote_ruv) static PRBool ignore_error_and_keep_going(int error) { - int return_value; + int return_value = PR_FALSE; switch (error) { diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index a1e74c44..8aabfdbb 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -306,7 +306,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, const char *extop_oid, struct berval *extop_payload, char **retoidp, struct berval **retdatap, LDAPControl ***returned_controls) { - int rc = LDAP_SUCCESS; + int rc = -1; ConnResult return_value; LDAPControl **loc_returned_controls; const char *op_string = NULL; @@ -316,7 +316,7 @@ windows_perform_operation(Repl_Connection *conn, int optype, const char *dn, if (windows_conn_connected(conn)) { - int msgid; + int msgid = -2; /* should match no messages */ conn->last_operation = optype; switch (optype) diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c index 65de19dd..3c6b4d4c 100644 --- a/ldap/servers/plugins/replication/windows_protocol_util.c +++ b/ldap/servers/plugins/replication/windows_protocol_util.c @@ -1640,7 +1640,7 @@ is_straight_mapped_attr(const char *type, int is_user /* or group */, int is_nt4 static int is_single_valued_attr(const char *type) { - int found; + int found = 0; size_t offset = 0; char *this_attr = NULL; diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c index a6646d89..4a884b79 100644 --- a/ldap/servers/plugins/views/views.c +++ b/ldap/servers/plugins/views/views.c @@ -1296,7 +1296,7 @@ static int views_dn_views_cb (Slapi_Entry* e, void *callback_data) { static int views_cache_add_dn_views(char *dn, viewEntry **pViews) { Slapi_PBlock *pDnSearch = 0; - struct dn_views_info info; + struct dn_views_info info = {NULL, -1}; pDnSearch = slapi_pblock_new(); if (pDnSearch) { info.ret=-1; diff --git a/ldap/servers/slapd/back-ldbm/idl.c b/ldap/servers/slapd/back-ldbm/idl.c index be564467..ca370768 100644 --- a/ldap/servers/slapd/back-ldbm/idl.c +++ b/ldap/servers/slapd/back-ldbm/idl.c @@ -1272,7 +1272,7 @@ void idl_insert(IDList **idl, ID id) static int idl_insert_maxids( IDList **idl, ID id, int maxids ) { - ID i, j; + ID i = 0, j = 0; NIDS nids; if ( ALLIDS( *idl ) ) { diff --git a/ldap/servers/slapd/backend_manager.c b/ldap/servers/slapd/backend_manager.c index 6456f299..98d9a961 100644 --- a/ldap/servers/slapd/backend_manager.c +++ b/ldap/servers/slapd/backend_manager.c @@ -391,7 +391,7 @@ be_unbindall(Connection *conn, Operation *op) if ( plugin_call_plugins( &pb, SLAPI_PLUGIN_PRE_UNBIND_FN ) == 0 ) { - int rc; + int rc = 0; slapi_pblock_set( &pb, SLAPI_PLUGIN, backends[i]->be_database ); if(backends[i]->be_state != BE_STATE_DELETED && backends[i]->be_unbind!=NULL) diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c index a67ec2ac..f24c9189 100644 --- a/ldap/servers/slapd/mapping_tree.c +++ b/ldap/servers/slapd/mapping_tree.c @@ -613,7 +613,7 @@ mapping_tree_entry_add(Slapi_Entry *entry, mapping_tree_node **newnodep ) Slapi_DN *subtree = NULL; const char *tmp_ndn; int be_list_count = 0; - int be_list_size; + int be_list_size = 0; backend **be_list = NULL; char **be_names = NULL; int * be_states = NULL; diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c index 4d1ac6a3..19805a8c 100644 --- a/ldap/servers/slapd/tools/ldclt/ldapfct.c +++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c @@ -2238,7 +2238,7 @@ getPending ( { LDAPMessage *res; /* LDAP async results */ int ret; /* Return values */ - int expected; /* Expect this type */ + int expected = 0; /* Expect this type */ char *verb; /* LDAP verb expected */ int type; /* Message type */ int errcodep; /* Async error code */ |