From: Luke Howard Date: Thu, 16 Jun 2005 05:31:24 +0000 (+0000) Subject: Fix OpenLDAP ITS#3782 - broken logic in bitwise matching rules X-Git-Tag: OPENLDAP_AC_BP~522 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f90800667d10804a7a017aa95ae577334c806776;p=openldap Fix OpenLDAP ITS#3782 - broken logic in bitwise matching rules --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 8d3feb8874..0ce73bb9b3 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2321,7 +2321,7 @@ integerBitAndMatch( return LDAP_CONSTRAINT_VIOLATION; } - *matchp = (lValue & lAssertedValue) ? 0 : 1; + *matchp = ((lValue & lAssertedValue) == lAssertedValue) ? 0 : 1; return LDAP_SUCCESS; } @@ -2352,7 +2352,7 @@ integerBitOrMatch( return LDAP_CONSTRAINT_VIOLATION; } - *matchp = (lValue | lAssertedValue) ? 0 : -1; + *matchp = ((lValue & lAssertedValue) != 0) ? 0 : -1; return LDAP_SUCCESS; }