Skip to content

Commit 30610bd

Browse files
committed
Added code to randomize values returned by rand()
1 parent fae12f6 commit 30610bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/HTTPserver.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,12 @@ HTTPserver::HTTPserver(const char *_docs_dir, const char *_scripts_dir) {
864864
bool use_http = true;
865865
struct stat statsBuf;
866866
int stat_rc;
867+
struct timeval tv;
867868

869+
/* Randomize data */
870+
gettimeofday(&tv, NULL);
871+
srand(tv.tv_sec + tv.tv_usec);
872+
868873
static char *http_options[] = {
869874
(char*)"listening_ports", ports,
870875
(char*)"enable_directory_listing", (char*)"no",

0 commit comments

Comments
 (0)