Skip to content
Snippets Groups Projects
Commit cf66f90e authored by deuce's avatar deuce
Browse files

Seed random number generator in the session thread, not in the server

thread.  (Low entropy issue)
parent 819012b5
Branches
Tags
No related merge requests found
...@@ -2676,6 +2676,9 @@ void http_session_thread(void* arg) ...@@ -2676,6 +2676,9 @@ void http_session_thread(void* arg)
thread_up(TRUE /* setuid */); thread_up(TRUE /* setuid */);
session.finished=FALSE; session.finished=FALSE;
srand(time(NULL)); /* Seed random number generator */
sbbs_random(10); /* Throw away first number */
if(startup->options&BBS_OPT_NO_HOST_LOOKUP) if(startup->options&BBS_OPT_NO_HOST_LOOKUP)
host=NULL; host=NULL;
else else
...@@ -3047,9 +3050,6 @@ void DLLCALL web_server(void* arg) ...@@ -3047,9 +3050,6 @@ void DLLCALL web_server(void* arg)
lprintf(LOG_INFO,"Compiled %s %s with %s", __DATE__, __TIME__, compiler); lprintf(LOG_INFO,"Compiled %s %s with %s", __DATE__, __TIME__, compiler);
srand(time(NULL)); /* Seed random number generator */
sbbs_random(10); /* Throw away first number */
if(!winsock_startup()) { if(!winsock_startup()) {
cleanup(1); cleanup(1);
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment