Commit ed7b9262 authored by David Gibson's avatar David Gibson

crypto/ripemd160: Correct badly sized union member

struct ripemd160_ctx has a union for converting between u8[] and u32[]
data.  Unfortunately the u32 array has a miscalculated size, half the size
of the u8 array.  That means some accesses which are within the union can
technically overrun the u32 array.

Found by Coverity scan.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent fb8e88fc
...@@ -49,7 +49,7 @@ struct ripemd160_ctx { ...@@ -49,7 +49,7 @@ struct ripemd160_ctx {
uint32_t s[5]; uint32_t s[5];
uint64_t bytes; uint64_t bytes;
union { union {
uint32_t u32[8]; uint32_t u32[16];
unsigned char u8[64]; unsigned char u8[64];
} buf; } buf;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment