]> git.sur5r.net Git - openldap/commitdiff
ITS#1681 - detect bad filter in slap_parseURI() - from Hallvard Furuseth
authorHoward Chu <hyc@openldap.org>
Tue, 9 Apr 2002 10:41:15 +0000 (10:41 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 9 Apr 2002 10:41:15 +0000 (10:41 +0000)
servers/slapd/saslauthz.c

index 4e03b68280f517daa935aba8a98a265f3b309741..5b78f4dd373c8b23e8fc1830870670acb3c9bea8 100644 (file)
@@ -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 );