diff options
author | Tom Gundersen <teg@jklm.no> | 2015-11-16 15:50:13 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-11-16 15:50:13 +0100 |
commit | f5ed8d4a51b7f168eba9114a7cf4c2a3132cafff (patch) | |
tree | aaf3b2b5a03de9ca3801a912ae42b7f61d95ff6e /src/libsystemd/sd-bus/bus-bloom.c | |
parent | 920a7262211254a6f728af5ed4f6cd7f9a83e9a6 (diff) | |
parent | dbe81cbd2a93088236a2e4e41eeb33378940f7b9 (diff) |
Merge pull request #1916 from zonque/align
siphash: alignment
Diffstat (limited to 'src/libsystemd/sd-bus/bus-bloom.c')
-rw-r--r-- | src/libsystemd/sd-bus/bus-bloom.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-bus/bus-bloom.c b/src/libsystemd/sd-bus/bus-bloom.c index 91fab90cb0..a592ff50cf 100644 --- a/src/libsystemd/sd-bus/bus-bloom.c +++ b/src/libsystemd/sd-bus/bus-bloom.c @@ -45,7 +45,7 @@ static void bloom_add_data( const void *data, /* Data to hash */ size_t n) { /* Size of data to hash in bytes */ - uint8_t h[8]; + uint64_t h; uint64_t m; unsigned w, i, c = 0; unsigned hash_index; @@ -72,11 +72,11 @@ static void bloom_add_data( for (d = 0; d < w; d++) { if (c <= 0) { - siphash24(h, data, n, hash_keys[hash_index++].bytes); + siphash24(&h, data, n, hash_keys[hash_index++].bytes); c += 8; } - p = (p << 8ULL) | (uint64_t) h[8 - c]; + p = (p << 8ULL) | (uint64_t) ((uint8_t *)&h)[8 - c]; c--; } |