]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#8989 fix bitshift integer overflow
authorHoward Chu <hyc@openldap.org>
Sun, 10 Mar 2019 14:23:00 +0000 (14:23 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 10 Mar 2019 14:26:08 +0000 (14:26 +0000)
servers/slapd/back-mdb/id2entry.c

index c9c0c38553cf24211e278495dd992ac056d39bf4..0d5f4e17ea53a78402b6e7792eeb7fad25eb8247 100644 (file)
@@ -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