From: Howard Chu Date: Mon, 23 Jun 2008 19:32:45 +0000 (+0000) Subject: ITS#5575, passwords now need to be NUL-terminated by us X-Git-Tag: LOCKER_IDS~88 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e7383994fb6ba7e662916ebf33ba9ae88246a742;p=openldap ITS#5575, passwords now need to be NUL-terminated by us --- diff --git a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c index de8d758bdf..32f2733f98 100644 --- a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c +++ b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c @@ -350,6 +350,7 @@ static int smbk5pwd_exop_passwd( Modifications *ml; slap_overinst *on = (slap_overinst *)op->o_bd->bd_info; smbk5pwd_t *pi = on->on_bi.bi_private; + char term; /* Not the operation we expected, pass it on... */ if ( ber_bvcmp( &slap_EXOP_MODIFY_PASSWD, &op->ore_reqoid ) ) { @@ -360,6 +361,9 @@ static int smbk5pwd_exop_passwd( rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &e ); if ( rc != LDAP_SUCCESS ) return rc; + term = qpw->rs_new.bv_val[qpw->rs_new.bv_len]; + qpw->rs_new.bv_val[qpw->rs_new.bv_len] = '\0'; + #ifdef DO_KRB5 /* Kerberos stuff */ do { @@ -596,6 +600,7 @@ static int smbk5pwd_exop_passwd( } #endif /* DO_SAMBA */ be_entry_release_r( op, e ); + qpw->rs_new.bv_val[qpw->rs_new.bv_len] = term; return SLAP_CB_CONTINUE; }