]> git.sur5r.net Git - openldap/commitdiff
coverity fix, slapd_rw_apply NULL filter
authorHoward Chu <hyc@openldap.org>
Tue, 8 May 2007 13:57:13 +0000 (13:57 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 8 May 2007 13:57:13 +0000 (13:57 +0000)
servers/slapd/sasl.c

index 7c02247dd6234710efbfaffa41f207a25b55cafc..9018185dcff5525941c0ff5bf25dce2a85e3570c 100644 (file)
@@ -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 );