From ab1bc728fa56983c44458ece4333ef07bd2e79af Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Fri, 31 Dec 2010 08:45:48 +0000 Subject: [PATCH] ITS#6758 bconfig.c: ensure sr_text==NULL if sr_err==LDAP_SUCCESS config_modify_internal(): Do not send rs->sr_text with success. config_back_modify(): When slap_bv2ad() can set rs->sr_text, set sr->sr_err too and catch failure. --- servers/slapd/bconfig.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index e650b02b2b..dda830388d 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -5825,6 +5825,7 @@ out: out_noop: if ( rc == LDAP_SUCCESS ) { attrs_free( save_attrs ); + rs->sr_text = NULL; } else { attrs_free( e->e_attrs ); e->e_attrs = save_attrs; @@ -5871,7 +5872,10 @@ config_back_modify( Operation *op, SlapReply *rs ) rdn = ce->ce_entry->e_nname; ptr = strchr( rdn.bv_val, '=' ); rdn.bv_len = ptr - rdn.bv_val; - slap_bv2ad( &rdn, &rad, &rs->sr_text ); + rs->sr_err = slap_bv2ad( &rdn, &rad, &rs->sr_text ); + if ( rs->sr_err != LDAP_SUCCESS ) { + goto out; + } /* Some basic validation... */ for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) { -- 2.39.5