From: Mark Wooding Date: Thu, 26 Sep 2019 16:03:46 +0000 (+0100) Subject: rand/noise.c: Fix foolish bug in the `getentropy' code. X-Git-Tag: 2.4.4~5 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/9c0c8fe0beddf7455d5f641835fe350b95dfec96 rand/noise.c: Fix foolish bug in the `getentropy' code. I've probably never built this before. :-/ --- diff --git a/rand/noise.c b/rand/noise.c index 280c49cb..c120e6f2 100644 --- a/rand/noise.c +++ b/rand/noise.c @@ -217,7 +217,7 @@ int noise_devrandom(rand_pool *r) /* --- OpenBSD-flavoured shinies --- */ while (n < sizeof(buf)) { - nn = sizeof(buf) - nn; + nn = sizeof(buf) - n; if (nn > 256) nn = 256; if (getentropy(buf + n, nn)) break; n += nn;