From: Howard Chu Date: Fri, 30 Nov 2007 18:12:17 +0000 (+0000) Subject: Fix 1.426, must sign-extend small numbers, not zero-pad X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~377 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b7f3bb05f58d143fabc36958014fd9a1d6d18b1d;p=openldap Fix 1.426, must sign-extend small numbers, not zero-pad --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index ee96f4e686..3d9cbb3b61 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2161,13 +2161,17 @@ integerIndexer( rc = LDAP_INVALID_SYNTAX; goto leave; } - /* If too small, pad with zeros */ + /* If too small, sign-extend */ if ( iv.bv_len < index_intlen ) { - int j, k; + int j, k, pad; keys[i].bv_val[0] = index_intlen; + if (iv.bv_val[0] & 0x80) + pad = 0xff; + else + pad = 0; k = index_intlen - iv.bv_len + 1; for ( j=1; j