From: Howard Chu Date: Sun, 10 Mar 2019 14:23:00 +0000 (+0000) Subject: ITS#8989 fix bitshift integer overflow X-Git-Tag: OPENLDAP_REL_ENG_2_5_0ALPHA~67^2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c825edf67e99f4bc100a8e36c9f23a79cf3b0e02;p=thirdparty%2Fopenldap.git ITS#8989 fix bitshift integer overflow --- diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index c9c0c38553..0d5f4e17ea 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -897,12 +897,12 @@ static int mdb_entry_partsize(struct mdb_info *mdb, MDB_txn *txn, Entry *e, } /* Flag bits for an encoded attribute */ -#define MDB_AT_SORTED (1<<(sizeof(unsigned int)*CHAR_BIT-1)) +#define MDB_AT_SORTED (1U<<(sizeof(unsigned int)*CHAR_BIT-1)) /* the values are in sorted order */ #define MDB_AT_MULTI (1<<(sizeof(unsigned int)*CHAR_BIT-2)) /* the values of this multi-valued attr are stored separately */ -#define MDB_AT_NVALS (1<<(sizeof(unsigned int)*CHAR_BIT-1)) +#define MDB_AT_NVALS (1U<<(sizeof(unsigned int)*CHAR_BIT-1)) /* this attribute has normalized values */ /* Flatten an Entry into a buffer. The buffer starts with the count of the