]> git.sur5r.net Git - openldap/commitdiff
integer indexing must be unsigned
authorHoward Chu <hyc@openldap.org>
Wed, 21 Nov 2007 03:07:09 +0000 (03:07 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 21 Nov 2007 03:07:09 +0000 (03:07 +0000)
servers/slapd/schema_init.c

index 960c55623c8875f0640e09eaf306ebdd8a6e28ea..6bdd95cf7576c77052dd6d45119eabe09afbea9e 100644 (file)
@@ -2180,6 +2180,8 @@ integerIndexer(
                        keys[i].bv_val[0] = iv.bv_len;
                        memcpy( keys[i].bv_val+1, iv.bv_val, index_intlen );
                }
+               /* convert signed to unsigned */
+               keys[i].bv_val[1] ^= 0x80;
        }
        *keysp = keys;
        rc = 0;
@@ -2245,6 +2247,9 @@ integerFilter(
                keys[0].bv_val[0] = iv.bv_len;
                memcpy( keys[0].bv_val+1, iv.bv_val, index_intlen );
        }
+       /* convert signed to unsigned */
+       keys[0].bv_val[1] ^= 0x80;
+
        rc = 0;
        *keysp = keys;
 leave: