diff options
| author | Mattias Andrée <m@maandree.se> | 2026-05-17 19:52:13 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-05-17 19:52:13 +0200 |
| commit | 4ad308fca3010379cb4a47023635fb2fcabb63a3 (patch) | |
| tree | 37318829e4ee505509116eae697cfda22345accb /libblake_blake2b_init.c | |
| parent | Fix alignment issues found by gcc santizer, and aliasing issue (diff) | |
| download | libblake-4ad308fca3010379cb4a47023635fb2fcabb63a3.tar.gz libblake-4ad308fca3010379cb4a47023635fb2fcabb63a3.tar.bz2 libblake-4ad308fca3010379cb4a47023635fb2fcabb63a3.tar.xz | |
Fix undefined behaviour3.0.2
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | libblake_blake2b_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libblake_blake2b_init.c b/libblake_blake2b_init.c index 9670bc3..9f22b12 100644 --- a/libblake_blake2b_init.c +++ b/libblake_blake2b_init.c @@ -42,8 +42,8 @@ libblake_blake2b_init(struct libblake_blake2b_state *state, const struct libblak # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wcast-align" #endif - state->h[0] ^= le64(((const uint_least64_t *)params)[0]); - state->h[1] ^= le64(((const uint_least64_t *)params)[1]); + state->h[0] ^= le64(((const uint_least64_t *)(const unsigned char *)params)[0]); + state->h[1] ^= le64(((const uint_least64_t *)(const unsigned char *)params)[1]); state->h[2] ^= le64(((uint_least64_t)params->node_depth << 0) | ((uint_least64_t)params->inner_len << 8)); state->h[4] ^= le64(*(const uint_least64_t *)¶ms->salt[0]); |
