From 01c1559311eacf46a184b6aff3ff09131e36fd2f Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Tue, 27 May 2008 22:16:35 +0000 Subject: [PATCH] ITS#5511 --- CHANGES | 1 + servers/slapd/overlays/unique.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index db2212f7c2..0e74f35650 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ OpenLDAP 2.4.10 Engineering Fixed slapo-syncprov op2.o_extra reset (ITS#5501, #5506) Fixed slapo-syncprov sending ops without queued CSNs (ITS#5465) Fixed slapo-unique config structs (ITS#5526) + Fixed slapo-unique filter terminator (ITS#5511) Documentation Add search privileges documentation (ITS#5512) diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index 037ceeccde..8866660825 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -250,7 +250,6 @@ unique_new_domain_uri ( unique_domain_uri **urip, filter_free( f ); } exit: - if ( bv.bv_val ) ber_memfree ( bv.bv_val ); uri->next = *urip; *urip = uri; if ( rc ) { @@ -1058,6 +1057,9 @@ unique_add( /* skip this domain-uri if it isn't involved */ if ( !ks ) continue; + /* terminating NUL */ + ks++; + if ( uri->filter.bv_val && uri->filter.bv_len ) ks += uri->filter.bv_len + STRLENOF ("(&)"); kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); @@ -1166,6 +1168,9 @@ unique_modify( /* skip this domain-uri if it isn't involved */ if ( !ks ) continue; + /* terminating NUL */ + ks++; + if ( uri->filter.bv_val && uri->filter.bv_len ) ks += uri->filter.bv_len + STRLENOF ("(&)"); kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); @@ -1299,6 +1304,9 @@ unique_modrdn( /* skip this domain if it isn't involved */ if ( !ks ) continue; + /* terminating NUL */ + ks++; + if ( uri->filter.bv_val && uri->filter.bv_len ) ks += uri->filter.bv_len + STRLENOF ("(&)"); kp = key = op->o_tmpalloc(ks, op->o_tmpmemctx); -- 2.39.5