From 33f485c1c3a0942192763f085292aa57d9c3de87 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 19 Jul 2013 17:44:20 +0000 Subject: [PATCH] It suddenly strikes me as probably a good idea to enforce that anyone calling random_byte has previously called random_ref. (I'm not aware of any current code getting this wrong! It just seems to me to be the sort of thing you'd want to be really sure of.) [originally from svn r9930] --- sshrand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sshrand.c b/sshrand.c index 4c33f4a0..85dfa0b6 100644 --- a/sshrand.c +++ b/sshrand.c @@ -234,6 +234,8 @@ void random_unref(void) int random_byte(void) { + assert(random_active); + if (pool.poolpos >= POOLSIZE) random_stir();