From ed7b9262aafed5df37dd70f0b604536576636056 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Sun, 2 Apr 2017 21:21:02 +1000 Subject: [PATCH] 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 --- ccan/crypto/ripemd160/ripemd160.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2