Nmap Development mailing list archives

Re: [PATCH] No need to seed the RNG with srand() in nbase/nbase_rnd.c


From: Kris Katterjohn <kjak () ispwest com>
Date: Mon, 21 Aug 2006 21:04:48 -0500

Fyodor wrote:
The "normal" random number generator is seeded with srand() in main() in
main.cc so it doesn't need to be done again in nbase/nbase_rnd.c (unless
I'm missing something?). They both seed it the same way.

Good point, though I actually don't mind this duplication.  We need it
in nbase because other users of the library (nmapfe, etc.) might not
do their own srand().  And I don't mind having it in Nmap just to be
on the safe side in case someone was to add a rand() or similar call
before the first Nbase get_random_* call.  Nmap does have some rand()
calls (though I should probably get rid of them).

Cheers,
-F


Okay, that makes sense. Sometimes it just doesn't register with me that
nbase is separate from nmap :-S


Thanks,
Kris Katterjohn

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: