]> git.sur5r.net Git - openldap/commitdiff
ITS#5794 NUL-terminate old pw before checking
authorHoward Chu <hyc@openldap.org>
Thu, 6 Nov 2008 16:47:05 +0000 (16:47 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 6 Nov 2008 16:47:05 +0000 (16:47 +0000)
servers/slapd/passwd.c

index 18d0bd2142fcd0fb7f7a0f3068c84ca568715a99..26a58a878266e1f526b15fec23a51c95c6073f8b 100644 (file)
@@ -228,8 +228,12 @@ int passwd_extop(
                if ( rc == LDAP_SUCCESS && e ) {
                        Attribute *a = attr_find( e->e_attrs,
                                slap_schema.si_ad_userPassword );
-                       if ( a )
+                       if ( a ) {
+                               char oldNul = qpw->rs_old.bv_val[qpw->rs_old.bv_len];
+                               qpw->rs_old.bv_val[qpw->rs_old.bv_len] = 0;
                                rc = slap_passwd_check( op, e, a, &qpw->rs_old, &rs->sr_text );
+                               qpw->rs_old.bv_val[qpw->rs_old.bv_len] = oldNul;
+                       }
                        else
                                rc = 1;
                        be_entry_release_r( op, e );