From f516e349182fc680f9749066a70b19e9e020380a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 9 Apr 2002 10:41:15 +0000 Subject: [PATCH] ITS#1681 - detect bad filter in slap_parseURI() - from Hallvard Furuseth --- servers/slapd/saslauthz.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 4e03b68280..5b78f4dd37 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -84,12 +84,16 @@ is_dn: bv.bv_len = uri->bv_len - (bv.bv_val - uri->bv_val); /* Grab the filter */ if ( ludp->lud_filter ) { *filter = str2filter( ludp->lud_filter ); + if ( *filter == NULL ) + rc = LDAP_PROTOCOL_ERROR; } /* Grab the searchbase */ - bv.bv_val = ludp->lud_dn; - bv.bv_len = strlen( bv.bv_val ); - rc = dnNormalize2( NULL, &bv, searchbase ); + if ( rc == LDAP_URL_SUCCESS ) { + bv.bv_val = ludp->lud_dn; + bv.bv_len = strlen( bv.bv_val ); + rc = dnNormalize2( NULL, &bv, searchbase ); + } ldap_free_urldesc( ludp ); -- 2.39.5