From: Ondřej Kuzník Date: Tue, 7 Apr 2026 15:23:23 +0000 (+0100) Subject: ITS#10476 Escape asserted value before pasting into filter X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=0347718de33ee4e3d0c3570166052c362da6080e;p=thirdparty%2Fopenldap.git ITS#10476 Escape asserted value before pasting into filter --- diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 3bf96e7829..68b8d7fbfd 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -2688,8 +2688,8 @@ pc_bind_attrs( Operation *op, Entry *e, QueryTemplate *temp, for ( i=0; ibindnattrs; i++ ) { a = attr_find( e->e_attrs, temp->bindfattrs[i] ); if ( a && a->a_vals ) { - vals[i] = a->a_vals[0]; - len += a->a_vals[0].bv_len; + filter_escape_value( &a->a_vals[0], &vals[i] ); + len += vals[i].bv_len; } else { vals[i] = pres; } @@ -2710,6 +2710,12 @@ pc_bind_attrs( Operation *op, Entry *e, QueryTemplate *temp, p1++; } *p2 = '\0'; + + for ( i=0; ibindnattrs; i++ ) { + if ( vals[i].bv_val != pres.bv_val ) { + ch_free( vals[i].bv_val ); + } + } op->o_tmpfree( vals, op->o_tmpmemctx ); /* FIXME: are we sure str2filter_x can't fail?