diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index f95ecb0e0..cf98643d3 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -167,6 +167,8 @@ int RAND_write_file(const char *file) ret+=i; if (n <= 0) break; } + if (ret > 0) + ftruncate(fileno(out), ret); fclose(out); memset(buf,0,BUFSIZE); err: