mirror of
https://github.com/nmap/nmap.git
synced 2026-01-08 23:49:03 +00:00
when the normal 8192-byte write buffer for log_write isn't big enough, we previously jumped it to 1,228,800 bytes. It turns out even that isn't enough in some cases, like the guy who just wrote me that was using '-p1-65535 -d6 -vvv -oA remotehost'. Sheesh. I had another person report the same sort of thing recently. So I'm upping it to 4MB. That ought to be enough for anybody :). On UNIX, vsnprintf is nice enough to tell us how much space we will need and so we don't have to worry about this. I also updated the error message to ask people to report it to nmap-dev rather than to me specifically
This commit is contained in:
@@ -1052,12 +1052,12 @@ void log_vwrite(int logt, const char *fmt, va_list ap) {
|
||||
/* Windows seems to just give -1 rather than the amount of space we
|
||||
would need. So lets just gulp up a huge amount in the hope it
|
||||
will be enough */
|
||||
writebuflen *= 150;
|
||||
writebuflen *= 500;
|
||||
}
|
||||
writebuf = (char *) safe_realloc(writebuf, writebuflen);
|
||||
len = Vsnprintf(writebuf, writebuflen, fmt, apcopy);
|
||||
if (len <= 0 || len >= writebuflen) {
|
||||
fatal("%s: vsnprintf failed. Even after increasing bufferlen to %d, Vsnprintf returned %d (logt == %d). Please email this message to fyodor@insecure.org. Quitting.", __func__, writebuflen, len, logt);
|
||||
fatal("%s: vsnprintf failed. Even after increasing bufferlen to %d, Vsnprintf returned %d (logt == %d). Please report this as a bug to nmap-dev (including this whole error message) as described at http://nmap.org/book/man-bugs.html. Quitting.", __func__, writebuflen, len, logt);
|
||||
}
|
||||
}
|
||||
if (logt == LOG_SKID && !skid_noxlate)
|
||||
|
||||
Reference in New Issue
Block a user