Browse Source

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 <david@gibson.dropbear.id.au>
David Gibson 8 years ago
parent
commit
ed7b9262aa
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ccan/crypto/ripemd160/ripemd160.h

+ 1 - 1
ccan/crypto/ripemd160/ripemd160.h

@@ -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