]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9126 Add a missed normalised copy of pwdChangedTime
authorOndřej Kuzník <ondra@mistotebe.net>
Thu, 23 Jan 2020 12:30:50 +0000 (12:30 +0000)
committerOndřej Kuzník <ondra@mistotebe.net>
Thu, 23 Jan 2020 23:15:09 +0000 (23:15 +0000)
servers/slapd/overlays/ppolicy.c

index 37dc6df745575f4fdd4412af0dd1c8fc5e358785..8653e9ce1ecb28b8ba8887751725ea0e389d7ad5 100644 (file)
@@ -2114,10 +2114,11 @@ do_modify:
                                mods = (Modifications *) ch_calloc( sizeof( Modifications ), 1 );
                                mods->sml_op = LDAP_MOD_REPLACE;
                                mods->sml_numvals = 1;
-                               mods->sml_values = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
+                               mods->sml_values = (BerVarray) ch_calloc( sizeof( struct berval ), 2 );
+                               mods->sml_nvalues = (BerVarray) ch_calloc( sizeof( struct berval ), 2 );
+
                                ber_dupbv( &mods->sml_values[0], &timestamp );
-                               BER_BVZERO( &mods->sml_values[1] );
-                               assert( !BER_BVISNULL( &mods->sml_values[0] ) );
+                               ber_dupbv( &mods->sml_nvalues[0], &timestamp );
                        } else if (attr_find(e->e_attrs, ad_pwdChangedTime )) {
                                mods = (Modifications *) ch_calloc( sizeof( Modifications ), 1 );
                                mods->sml_op = LDAP_MOD_DELETE;