From 2ff41576f3f4f7ae310cce9c7bf8baf60f2a8873 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 10 Aug 2005 20:56:35 +0000 Subject: 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 --- ldap/servers/plugins/uiduniq/7bit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldap/servers/plugins/uiduniq/7bit.c b/ldap/servers/plugins/uiduniq/7bit.c index cfea16fd..fb340fa3 100644 --- a/ldap/servers/plugins/uiduniq/7bit.c +++ b/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)++; } -- cgit