From e00c1bc6e9e08b7d4deae27272b2409c3f03c707 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 25 Feb 2014 10:24:22 +0100 Subject: [PATCH] miniupnpd.c: init random number generator in init() --- miniupnpd/miniupnpd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miniupnpd/miniupnpd.c b/miniupnpd/miniupnpd.c index 3840833..8bd4a0f 100644 --- a/miniupnpd/miniupnpd.c +++ b/miniupnpd/miniupnpd.c @@ -706,6 +706,7 @@ void complete_uuidvalues(void) * 6) set startup time stamp * 7) compute presentation URL * 8) set signal handlers + * 9) init random generator (srandom()) * 10) init redirection engine * 11) reload mapping from leasefile */ static int @@ -1265,6 +1266,9 @@ init(int argc, char * * argv, struct runtime_vars * v) syslog(LOG_NOTICE, "Failed to set %s handler", "SIGUSR1"); } + /* initialize random number generator */ + srandom((unsigned int)time(NULL)); + /* initialize redirection engine (and pinholes) */ if(init_redirect() < 0) {