diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-07-02 00:16:08 -0500 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-23 11:05:49 -0700 |
commit | 2237cbb7f9bdadfee9913f32a71eccd73d57d27b (patch) | |
tree | c26ed2e9dc5e996ac6bad8129d4bd02bd2fad203 | |
parent | c54c70e436c23bba9aac296285fd3e0f417f334d (diff) | |
download | ds-2237cbb7f9bdadfee9913f32a71eccd73d57d27b.tar.gz ds-2237cbb7f9bdadfee9913f32a71eccd73d57d27b.tar.xz ds-2237cbb7f9bdadfee9913f32a71eccd73d57d27b.zip |
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
https://bugzilla.redhat.com/show_bug.cgi?id=610119
Resolves: bug 610119
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Fix description: Catch possible NULL pointer in ids_sasl_check_bind().
-rw-r--r-- | ldap/servers/slapd/saslbind.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 58703657..ecc935c2 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -966,11 +966,10 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) bind_target_entry = get_entry(pb, dn); if ( bind_target_entry == NULL ) { - break; + goto out; } if ( slapi_check_account_lock(pb, bind_target_entry, pwresponse_requested, 1, 1) == 1) { - slapi_entry_free(bind_target_entry); - break; + goto out; } } @@ -1003,10 +1002,6 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) int pwrc; pwrc = need_new_pw(pb, &t, bind_target_entry, pwresponse_requested); - if ( bind_target_entry != NULL ) { - slapi_entry_free(bind_target_entry); - bind_target_entry = NULL; - } switch (pwrc) { case 1: @@ -1081,6 +1076,8 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) slapi_entry_free(referral); if (be) slapi_be_Unlock(be); + if (bind_target_entry) + slapi_entry_free(bind_target_entry); LDAPDebug( LDAP_DEBUG_TRACE, "=> ids_sasl_check_bind\n", 0, 0, 0 ); |