Browse Source

Bug 609590 - fix coverity Defect Type: Memory - corruptions issues

https://bugzilla.redhat.com/show_bug.cgi?id=609590
Resolves: bug 609590
Bug Description: fix coverity Defect Type: Memory - corruptions issues
Reviewed by: nhosoi (Thanks!)
Branch: HEAD
Fix Description: The code wants to allocate space for a struct berval, not
struct berval *.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
Rich Megginson 15 years ago
parent
commit
138daaa4b1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ldap/servers/slapd/tools/ldclt/ldapfct.c

+ 1 - 1
ldap/servers/slapd/tools/ldclt/ldapfct.c

@@ -1523,7 +1523,7 @@ buildNewModAttribFile (
 {
   int		 nbAttribs;	/* Nb of attributes */
   LDAPMod	 attribute;	/* To build the attributes */
-  struct berval	*bv = malloc(sizeof(struct berval *));
+  struct berval	*bv = malloc(sizeof(struct berval));
   attribute.mod_bvalues = (struct berval **)malloc(2 * sizeof(struct berval *));
 
   if ((bv == NULL) || (attribute.mod_bvalues == NULL)) {