]> git.sur5r.net Git - openldap/commitdiff
Fix copy/paste error in prev commit
authorHoward Chu <hyc@openldap.org>
Fri, 14 Aug 2015 14:33:32 +0000 (15:33 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 21 Aug 2015 21:34:17 +0000 (16:34 -0500)
servers/slapd/overlays/ppolicy.c

index 7af3ca20597fffaef44991bd843128ec8b95f18f..0b55a1654a4dc81dd2b7b76d162c0a10bf7ea5b7 100644 (file)
@@ -1027,8 +1027,8 @@ ppolicy_bind_response( Operation *op, SlapReply *rs )
                                        nv = m->sml_nvalues[0];
                                        ch_free(m->sml_values);
                                        ch_free(m->sml_nvalues);
-                                       m->sml_values = ch_calloc( sizeof(struct berval), 2 );
-                                       m->sml_nvalues = ch_calloc( sizeof(struct berval), 2 );
+                                       m->sml_values = ch_calloc( sizeof(struct berval), ppb->pp.pwdMaxRecordedFailure+1 );
+                                       m->sml_nvalues = ch_calloc( sizeof(struct berval), ppb->pp.pwdMaxRecordedFailure+1 );
                                        for (i=0; i<j; i++) {
                                                ber_dupbv(&m->sml_values[i], &a->a_vals[a->a_numvals-j+i]);
                                                ber_dupbv(&m->sml_nvalues[i], &a->a_nvals[a->a_numvals-j+i]);
@@ -1042,8 +1042,8 @@ ppolicy_bind_response( Operation *op, SlapReply *rs )
                                        m->sml_type = ad_pwdFailureTime->ad_cname;
                                        m->sml_desc = ad_pwdFailureTime;
                                        m->sml_numvals = a->a_numvals - j;
-                                       m->sml_values = ch_calloc( sizeof(struct berval), m->sml_numvals );
-                                       m->sml_nvalues = ch_calloc( sizeof(struct berval), m->sml_numvals );
+                                       m->sml_values = ch_calloc( sizeof(struct berval), m->sml_numvals+1 );
+                                       m->sml_nvalues = ch_calloc( sizeof(struct berval), m->sml_numvals+1 );
                                        for (i=0; i<m->sml_numvals; i++) {
                                                ber_dupbv(&m->sml_values[i], &a->a_vals[i]);
                                                ber_dupbv(&m->sml_nvalues[i], &a->a_nvals[i]);