From: Hallvard Furuseth Date: Sun, 28 Mar 1999 01:40:54 +0000 (+0000) Subject: Avoid integer truncation of v1->bv_len - v2->bv_len in value_cmp(,,SYNTAX_BIN,) X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~321 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3f6dc76a5943cfc34a5803e3209596c87e93be22;p=openldap Avoid integer truncation of v1->bv_len - v2->bv_len in value_cmp(,,SYNTAX_BIN,) --- diff --git a/servers/slapd/value.c b/servers/slapd/value.c index c14e8da70f..ccabdf06a4 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -134,8 +134,9 @@ value_cmp( break; case SYNTAX_BIN: - rc = ( v1->bv_len == v2->bv_len ) ? memcmp( v1->bv_val, - v2->bv_val, v1->bv_len ) : v1->bv_len - v2->bv_len ; + rc = (v1->bv_len == v2->bv_len + ? memcmp( v1->bv_val, v2->bv_val, v1->bv_len ) + : v1->bv_len > v2->bv_len ? 1 : -1); break; }