From: David Gibson Date: Sun, 2 Apr 2017 11:21:02 +0000 (+1000) Subject: crypto/ripemd160: Correct badly sized union member X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=ed7b9262aafed5df37dd70f0b604536576636056 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: David Gibson --- diff --git a/ccan/crypto/ripemd160/ripemd160.h b/ccan/crypto/ripemd160/ripemd160.h index 377a07df..56854cff 100644 --- a/ccan/crypto/ripemd160/ripemd160.h +++ b/ccan/crypto/ripemd160/ripemd160.h @@ -49,7 +49,7 @@ struct ripemd160_ctx { uint32_t s[5]; uint64_t bytes; union { - uint32_t u32[8]; + uint32_t u32[16]; unsigned char u8[64]; } buf; #endif