Browse Source

Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166

https://bugzilla.redhat.com/show_bug.cgi?id=611790
Resolves: bug 611790
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166
Fix description: Catch possible NULL pointer in print_access_control_summary().
Endi S. Dewata 15 years ago
parent
commit
da27ed662d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      ldap/servers/plugins/acl/acl.c

+ 6 - 1
ldap/servers/plugins/acl/acl.c

@@ -702,6 +702,11 @@ static void print_access_control_summary( char *source, int ret_val, char *clien
 		return;
 		return;
 	}
 	}
 
 
+	if ( !aclpb ) {
+		slapi_log_error ( SLAPI_LOG_FATAL, plugin_name,  "Missing aclpb \n" );
+		return;
+	}
+
 	slapi_pblock_get(aclpb->aclpb_pblock, SLAPI_OPERATION, &op); /* for logging */
 	slapi_pblock_get(aclpb->aclpb_pblock, SLAPI_OPERATION, &op); /* for logging */
 
 
 	if (ret_val == LDAP_INSUFFICIENT_ACCESS) {
 	if (ret_val == LDAP_INSUFFICIENT_ACCESS) {
@@ -756,7 +761,7 @@ static void print_access_control_summary( char *source, int ret_val, char *clien
 			
 			
 	/* Is there a proxy */
 	/* Is there a proxy */
 
 
-	if ( aclpb != NULL && aclpb->aclpb_proxy != NULL) {
+	if ( aclpb->aclpb_proxy != NULL) {
 
 
 		if ( aclpb->aclpb_authorization_sdn != NULL ) {
 		if ( aclpb->aclpb_authorization_sdn != NULL ) {