浏览代码

Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891

https://bugzilla.redhat.com/show_bug.cgi?id=614511
Resolves: bug 614511
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
description: Catch possible NULL pointer in aclg_get_usersGroup().
Endi S. Dewata 15 年之前
父节点
当前提交
cdb214a72e
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      ldap/servers/plugins/acl/aclgroup.c

+ 7 - 2
ldap/servers/plugins/acl/aclgroup.c

@@ -273,14 +273,19 @@ aclg_get_usersGroup ( struct acl_pblock *aclpb , char *n_dn)
 
 	aclUserGroup		*u_group, *f_group;
 
-	if ( aclpb && aclpb->aclpb_groupinfo )
+	if ( !aclpb ) {
+		slapi_log_error( SLAPI_LOG_ACL, plugin_name, "NULL acl pblock\n" );
+		return NULL;
+	}
+
+	if ( aclpb->aclpb_groupinfo )
 		return aclpb->aclpb_groupinfo;
 
 	ACLG_LOCK_GROUPCACHE_WRITE();
 
 	/* try it one more time. We might have one in the meantime */
 	aclg_init_userGroup  (aclpb, n_dn , 1 /* got the lock */);
-	if ( aclpb && aclpb->aclpb_groupinfo ) {
+	if ( aclpb->aclpb_groupinfo ) {
 		ACLG_ULOCK_GROUPCACHE_WRITE();
 		return aclpb->aclpb_groupinfo;
 	}