mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-27 09:22:03 +00:00
crypto: rng_make_prng prevent buf overflow
with bits set to 1023, buf of 256 bytes was filled by rng_get_bytes up to 257 bytes. Buf is now 258 bytes so it's no longer problem. Signed-off-by: Jan Friesse <jfriesse@redhat.com> Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
parent
afa0398ca4
commit
50f05bfa15
@ -1314,7 +1314,7 @@ unsigned long rng_get_bytes(unsigned char *buf, unsigned long len,
|
||||
int rng_make_prng(int bits, int wprng, prng_state *prng,
|
||||
void (*callback)(void))
|
||||
{
|
||||
unsigned char buf[256];
|
||||
unsigned char buf[258];
|
||||
int err;
|
||||
|
||||
if (bits < 64 || bits > 1024) {
|
||||
|
Loading…
Reference in New Issue
Block a user