X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/32874aeac8dacbca26663777b39a79efc5d8dc4b..5dc6132d3a8e6e4048698bf1914b486f9cf41e2c:/sshrand.c diff --git a/sshrand.c b/sshrand.c index 3014da4f..95c7b492 100644 --- a/sshrand.c +++ b/sshrand.c @@ -39,7 +39,7 @@ struct RandPool { }; static struct RandPool pool; -static int random_active = 0; +int random_active = 0; void random_stir(void) { @@ -201,7 +201,10 @@ int random_byte(void) void random_get_savedata(void **data, int *len) { + void *buf = smalloc(POOLSIZE / 2); random_stir(); - *data = pool.pool + pool.poolpos; + memcpy(buf, pool.pool + pool.poolpos, POOLSIZE / 2); *len = POOLSIZE / 2; + *data = buf; + random_stir(); }