ldap/servers/plugins/memberof/memberof_config.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit e6343e66aa2e4537388b386c055b7ca8044f8f34
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Aug 10 10:42:40 2015 -0400
Ticket 47931 - Fix coverity issues
Description: Fix coverity issues in memberof_config.c
13316 - double free
13315 - Dereference after null check
13314 - Dereference after null check
13313 - copy/paste error
https://fedorahosted.org/389/ticket/47931
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 5daea973e4526584ee41d7b9f4b1b4993b4de6f1)
(cherry picked from commit 9a0047ef75f6dbeb1980ac77fab5d62865c77e6a)
diff --git a/ldap/servers/plugins/memberof/memberof_config.c
b/ldap/servers/plugins/memberof/memberof_config.c
index 9db3b39..e718f8d 100644
--- a/ldap/servers/plugins/memberof/memberof_config.c
+++ b/ldap/servers/plugins/memberof/memberof_config.c
@@ -345,6 +345,7 @@ memberof_validate_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore,
Slapi_Entr
"%s: Invalid DN (%s) for include suffix.",
MEMBEROF_PLUGIN_SUBSYSTEM, entry_scopes[i]);
slapi_ch_array_free(entry_scopes);
+ entry_scopes = NULL;
theConfig.entryScopeCount = 0;
*returncode = LDAP_UNWILLING_TO_PERFORM;
goto done;
@@ -370,8 +371,9 @@ memberof_validate_config (Slapi_PBlock *pb, Slapi_Entry* entryBefore,
Slapi_Entr
/* invalid dn syntax */
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
"%s: Invalid DN (%s) for exclude suffix.",
- MEMBEROF_PLUGIN_SUBSYSTEM, entry_scopes[i]);
+ MEMBEROF_PLUGIN_SUBSYSTEM, entry_exclude_scopes[i]);
slapi_ch_array_free(entry_exclude_scopes);
+ entry_exclude_scopes = NULL;
*returncode = LDAP_UNWILLING_TO_PERFORM;
goto done;
}
@@ -770,7 +772,7 @@ memberof_copy_config(MemberOfConfig *dest, MemberOfConfig *src)
int num_vals = 0;
dest->entryScopeExcludeSubtrees = (Slapi_DN **)slapi_ch_calloc(sizeof(Slapi_DN
*),src->entryExcludeScopeCount+1);
- for(num_vals = 0; src->entryScopes[num_vals]; num_vals++){
+ for(num_vals = 0; src->entryScopeExcludeSubtrees[num_vals]; num_vals++){
dest->entryScopeExcludeSubtrees[num_vals] =
slapi_sdn_dup(src->entryScopeExcludeSubtrees[num_vals]);
}
}