]> git.sur5r.net Git - openldap/commitdiff
Avoid integer truncation of v1->bv_len - v2->bv_len in value_cmp(,,SYNTAX_BIN,)
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 28 Mar 1999 01:40:54 +0000 (01:40 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 28 Mar 1999 01:40:54 +0000 (01:40 +0000)
servers/slapd/value.c

index c14e8da70f395aafa4c019b583f82c1cebbb8474..ccabdf06a42ae84c2e6250a0591da93e163f6d84 100644 (file)
@@ -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;
        }