mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 08:59:01 +00:00
Fixed a off-by-one error in printtableSize(). The routine was not
taking into account the fact that each row gets a newline appended and so was reporting less needed memory that actually necessary in very special cases. Patrick found the issue and reported it in http://seclists.org/nmap-dev/2009/q1/0735.html
This commit is contained in:
@@ -233,8 +233,8 @@ int NmapOutputTable::printableSize() {
|
||||
// roles then the maximal rowlen needs to be adjusted.
|
||||
for(i = 0; i < numRows; i++) {
|
||||
cell = getCellAddy(i, 0);
|
||||
if(cell->fullrow && cell->strlength > rowlen)
|
||||
rowlen = cell->strlength;
|
||||
if(cell->fullrow && cell->strlength + 1 > rowlen)
|
||||
rowlen = cell->strlength + 1; /* Account for the newline with the +1 */
|
||||
}
|
||||
|
||||
return rowlen * numRows;
|
||||
|
||||
Reference in New Issue
Block a user