estimating the worst-possible-case memory usage (the longest row
length times the number of rows) to a more reasonable dynamic
allocation of memory. Now the buffer is started at 512 bytes and
approximately doubled each time it fills. 512 bytes is a compromise
that was determined empirically. Most regular scans use less than 512
bytes. Scans with -sV and especially -sC tend to use a few k of
memory.
See http://seclists.org/nmap-dev/2009/q1/0782.html for the tests.
Ensuring the safety of assert() calls by keeping NDEBUG undefined throughout
Nmap, Nbase and Nsock.
I've tested this on Linux and Windows XP without problems. On Windows I've
removed the definitions of _DEBUG and NDEBUG from the *.vcproj files.