From: Howard Chu Date: Sat, 29 Dec 2007 02:32:22 +0000 (+0000) Subject: ITS#5300, reject substring filters with empty values X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~262 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd673c2ff27d7f2a718396e7e1cfba28b310c31e;p=openldap ITS#5300, reject substring filters with empty values --- diff --git a/libraries/libldap/filter.c b/libraries/libldap/filter.c index 6709540885..3ad77c4fdb 100644 --- a/libraries/libldap/filter.c +++ b/libraries/libldap/filter.c @@ -751,10 +751,12 @@ put_substring_filter( BerElement *ber, char *type, char *val ) } } - if ( *val != '\0' || ftype == LDAP_SUBSTRING_ANY ) { + if ( *val == '\0' ) { + return -1; + } else { ber_slen_t len = ldap_pvt_filter_value_unescape( val ); - if ( len < 0 ) { + if ( len <= 0 ) { return -1; }