From b87965303ead157825d1f2e107974943b4f643e9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 8 May 2007 13:57:13 +0000 Subject: [PATCH] coverity fix, slapd_rw_apply NULL filter --- servers/slapd/sasl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 7c02247dd6..9018185dcf 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -1121,8 +1121,12 @@ slapd_rw_apply( void *private, const char *filter, struct berval *val ) ptr = op->ors_filterstr.bv_val = op->o_tmpalloc( rc + 1, op->o_tmpmemctx ); if ( sl->filter.bv_len ) { ptr = lutil_strcopy( ptr, sl->filter.bv_val ); + } else { + *ptr = '\0'; + } + if ( filter ) { + strcpy( ptr, filter ); } - strcpy( ptr, filter ); op->ors_filter = str2filter_x( op, op->ors_filterstr.bv_val ); if ( !op->ors_filter ) { op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx ); -- 2.39.5