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_blake2s_init.c | |
| parent | Fix alignment issues found by gcc santizer, and aliasing issue (diff) | |
| download | libblake-be668f5fcc67e44ace06d507b8248afefcad2d00.tar.gz libblake-be668f5fcc67e44ace06d507b8248afefcad2d00.tar.bz2 libblake-be668f5fcc67e44ace06d507b8248afefcad2d00.tar.xz | |
Fix undefined behaviour3.0.2
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | libblake_blake2s_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libblake_blake2s_init.c b/libblake_blake2s_init.c index 6c04332..197715f 100644 --- a/libblake_blake2s_init.c +++ b/libblake_blake2s_init.c @@ -38,8 +38,8 @@ libblake_blake2s_init(struct libblake_blake2s_state *state, const struct libblak # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wcast-align" #endif - state->h[0] ^= le32(((const uint_least32_t *)params)[0]); - state->h[1] ^= le32(((const uint_least32_t *)params)[1]); + state->h[0] ^= le32(((const uint_least32_t *)(const unsigned char *)params)[0]); + state->h[1] ^= le32(((const uint_least32_t *)(const unsigned char *)params)[1]); state->h[2] ^= le32((uint_least32_t)(params->node_offset >> 0)); state->h[3] ^= le32(((uint_least32_t)(params->node_offset >> 32) & UINT_LEAST32_C(0xFFFF)) | ((uint_least32_t)params->node_depth << 16) | |
