]> 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)
committerHoward Chu <hyc@openldap.org>
Fri, 14 Aug 2015 14:33:32 +0000 (15:33 +0100)
servers/slapd/overlays/ppolicy.c

index 51343fcdbf62530f41574130e0c42d2d06b62120..90838872969897c405e28897fb1c7777767df5f0 100644 (file)
@@ -1031,8 +1031,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]);
@@ -1046,8 +1046,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]);