mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 21:29:06 +00:00
potential fix for the Nbase get_random_bytes() bug on Windows
This commit is contained in:
5
main.cc
5
main.cc
@@ -157,7 +157,6 @@ int main(int argc, char *argv[]) {
|
||||
char *endptr;
|
||||
int interactivemode = 0;
|
||||
int fd;
|
||||
struct timeval tv;
|
||||
int arglen = 0;
|
||||
|
||||
#ifdef __amigaos__
|
||||
@@ -180,10 +179,6 @@ int main(int argc, char *argv[]) {
|
||||
mtrace();
|
||||
#endif
|
||||
|
||||
/* You never know when "random" numbers will come in handy ... */
|
||||
gettimeofday(&tv, NULL);
|
||||
srand((tv.tv_sec ^ tv.tv_usec) ^ getpid());
|
||||
|
||||
/* Trap these sigs for cleanup */
|
||||
#if HAVE_SIGNAL
|
||||
signal(SIGINT, sigdie);
|
||||
|
||||
6
nmap.cc
6
nmap.cc
@@ -505,6 +505,7 @@ int nmap_main(int argc, char *argv[]) {
|
||||
size_t sslen;
|
||||
int option_index;
|
||||
bool iflist = false;
|
||||
struct timeval tv;
|
||||
|
||||
// Pre-specified timing parameters.
|
||||
// These are stored here during the parsing of the arguments so that we can
|
||||
@@ -647,6 +648,11 @@ int nmap_main(int argc, char *argv[]) {
|
||||
fakeargv[argc] = NULL;
|
||||
|
||||
if (argc < 2 ) printusage(argv[0], -1);
|
||||
|
||||
/* You never know when "random" numbers will come in handy ... */
|
||||
gettimeofday(&tv, NULL);
|
||||
srand((tv.tv_sec ^ tv.tv_usec) ^ getpid() + 31337);
|
||||
|
||||
Targets.reserve(100);
|
||||
#ifdef WIN32
|
||||
win_pre_init();
|
||||
|
||||
Reference in New Issue
Block a user