Bläddra i källkod

Bug(s) fixed: 165600
Bug Description: Adding multiple attributes using a single ldapmodify crashes ns-slapd
Reviewed by: Nathan (Thanks!)
Fix Description: In C, the array '[]' dereference operator takes precedence over the '*' deref operator. In this case, I needed to put parentheses around the pointer dereference to avoid having array dereferenced first. modary is a pointer to an array, not an array, so I can't dereference it with the array operator until I first dereference the pointer.
Platforms tested: RHEL3
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Rich Megginson 20 år sedan
förälder
incheckning
2ff41576f3
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      ldap/servers/plugins/uiduniq/7bit.c

+ 1 - 1
ldap/servers/plugins/uiduniq/7bit.c

@@ -344,7 +344,7 @@ addMod(LDAPMod ***modary, int *capacity, int *nmods, LDAPMod *toadd)
       *modary = (LDAPMod **)slapi_ch_malloc(*capacity * sizeof(LDAPMod *));
     }
   }
-  *modary[*nmods] = toadd;
+  (*modary)[*nmods] = toadd;
   (*nmods)++;
 }