1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Improve robustness in random seed file handling.

[originally from svn r2200]
This commit is contained in:
Simon Tatham
2002-11-07 20:01:04 +00:00
parent 7c95ea19c8
commit a1125a8052
4 changed files with 16 additions and 3 deletions

View File

@ -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();
}