From: Pierangelo Masarati Date: Thu, 14 Feb 2002 18:01:15 +0000 (+0000) Subject: not-so-easy-to-spot bug in filter writing X-Git-Tag: OPENLDAP_REL_ENG_2_1_BP~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c31596eb78c481a45739a92c0d63325248c9f8be;p=openldap not-so-easy-to-spot bug in filter writing --- diff --git a/libraries/libldap/filter.c b/libraries/libldap/filter.c index 60fd907975..c3621bc720 100644 --- a/libraries/libldap/filter.c +++ b/libraries/libldap/filter.c @@ -721,14 +721,15 @@ put_substring_filter( BerElement *ber, char *type, char *val ) if ( *nextstar == '\0' ) { ftype = LDAP_SUBSTRING_FINAL; - } else if ( gotstar++ == 0 ) { - ftype = LDAP_SUBSTRING_INITIAL; } else { - ftype = LDAP_SUBSTRING_ANY; + *nextstar++ = '\0'; + if ( gotstar++ == 0 ) { + ftype = LDAP_SUBSTRING_INITIAL; + } else { + ftype = LDAP_SUBSTRING_ANY; + } } - *nextstar++ = '\0'; - if ( *val != '\0' || ftype == LDAP_SUBSTRING_ANY ) { ber_slen_t len = ldap_pvt_filter_value_unescape( val );