From: Hallvard Furuseth Date: Wed, 14 Aug 2013 13:21:59 +0000 (+0200) Subject: Tweak ITS#7615 fix: Obey strict-aliasing rules. X-Git-Tag: OPENLDAP_REL_ENG_2_4_36^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=82b27c09c979e0f3e425bb14b64c5a0a28e04aab;p=openldap Tweak ITS#7615 fix: Obey strict-aliasing rules. Do not access a long long as an array of longs. --- diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index ee7f77169a..34b726cd62 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3607,10 +3607,9 @@ static void mdb_hash_enc(MDB_val *val, char *encbuf) { mdb_hash_t h = mdb_hash_val(val, MDB_HASH_INIT); - unsigned long *l = (unsigned long *)&h; - mdb_pack85(l[0], encbuf); - mdb_pack85(l[1], encbuf+5); + mdb_pack85(h, encbuf); + mdb_pack85(h>>32, encbuf+5); encbuf[10] = '\0'; } #endif