Not sure how to test this, but...
index b93b9ba47..cfa82d13c 100644 --- a/lib/randutils.c +++ b/lib/randutils.c @@ -81,8 +81,10 @@ void random_get_bytes(void *buf, size_t nbytes) while (n > 0) { ssize_t x = read(fd, cp, n); if (x <= 0) { - if (lose_counter++ > 16) + if (lose_counter++ > 16) { + while (n--) *cp++ = rand(); break; + } continue; } n -= x;
Not sure how to test this, but...
index b93b9ba47. .cfa82d13c 100644 get_bytes( void *buf, size_t nbytes)
while (n > 0) {
ssize_ t x = read(fd, cp, n);
if (x <= 0) {
break;
continue;
}
n -= x;
--- a/lib/randutils.c
+++ b/lib/randutils.c
@@ -81,8 +81,10 @@ void random_
- if (lose_counter++ > 16)
+ if (lose_counter++ > 16) {
+ while (n--) *cp++ = rand();
+ }