]> git.sur5r.net Git - openldap/commitdiff
ITS#5800
authorQuanah Gibson-Mount <quanah@openldap.org>
Mon, 10 Nov 2008 23:39:09 +0000 (23:39 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 10 Nov 2008 23:39:09 +0000 (23:39 +0000)
CHANGES
contrib/slapd-modules/nssov/group.c

diff --git a/CHANGES b/CHANGES
index 13c9983032e22c9025ed33e91c6baf14308f8e75..2eb5e2d2e8339b96f30bbfa9bc43864f323bff48 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -59,6 +59,7 @@ OpenLDAP 2.4.13 Engineering
        Added slapo-translucent support for PasswordModify exop (ITS#5656)
        Fixed tools simple bind without SASL (ITS#5753)
        Fixed tools unaligned BerElement (ITS#5770)
+       Fixed contriv nssov crash on empty groups (ITS#5800)
        Added contrib smbk5pwd honor principal expiration (ITS#5766)
        Build Environment
                Added ldapurl command
index 4cbdf7b4afc7fe423e2abd292bd189b3b56e5935..4c13acedbadd8bdccd4143cd31745564c1252c00 100644 (file)
@@ -191,26 +191,31 @@ static int write_group(nssov_group_cbp *cbp,Entry *entry)
                        i += a->a_numvals;
                if ( b )
                        i += b->a_numvals;
-               if ( i )
+               if ( i ) {
                        members = cbp->op->o_tmpalloc( (i+1) * sizeof(struct berval), cbp->op->o_tmpmemctx );
                        
-               if ( a ) {
-                       for (i=0; i<a->a_numvals; i++) {
-                               if (isvalidusername(&a->a_vals[i])) {
-                                       ber_dupbv_x(&members[j],&a->a_vals[i],cbp->op->o_tmpmemctx);
-                                       j++;
+                       if ( a ) {
+                               for (i=0; i<a->a_numvals; i++) {
+                                       if (isvalidusername(&a->a_vals[i])) {
+                                               ber_dupbv_x(&members[j],&a->a_vals[i],cbp->op->o_tmpmemctx);
+                                               j++;
+                                       }
                                }
                        }
-               }
-               a = b;
-               if ( a ) {
-                       for (i=0; i<a->a_numvals; i++) {
-                               if (nssov_dn2uid(cbp->op,cbp->ni,&a->a_nvals[i],&members[j]))
-                                       j++;
+                       a = b;
+                       if ( a ) {
+                               for (i=0; i<a->a_numvals; i++) {
+                                       if (nssov_dn2uid(cbp->op,cbp->ni,&a->a_nvals[i],&members[j]))
+                                               j++;
+                               }
                        }
+                       nummembers = j;
+                       BER_BVZERO(&members[j]);
+               } else {
+                       members=NULL;
+                       nummembers = 0;
                }
-               nummembers = j;
-               BER_BVZERO(&members[j]);
+
        } else {
                members=NULL;
                nummembers = 0;