mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
potential fix for the Nbase get_random_bytes() bug on Windows
This commit is contained in:
parent
f8b3f905c7
commit
884395da68
2 changed files with 6 additions and 5 deletions
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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue