Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase buffer for nmap arguments when "--resume" a scan #1659

wants to merge 1 commit into from


Copy link

@cnotin cnotin commented Jul 10, 2019

I have a complicated nmap scan with a long list of ports (used both for "-PS", SYN ping, and "-p", SYN port scan).
Here is what happens when I try to resume this scan (using the .nmap or .gnmap files):

nmap --resume myscan.nmap
Unable to parse supposed log file myscan.nmap. Perhaps the Nmap execution had not finished at least one host? In that case there is no use "resuming"

I found that the issue is that the arguments string length is higher than 1024 which is currently not supported:


Line 2339 in 23ee017

char nmap_arg_buffer[1024];


Lines 2392 to 2393 in 23ee017

if (!q || ((unsigned int) (q - p) >= sizeof(nmap_arg_buffer) - 32))
fatal("Unable to parse supposed log file %s. Perhaps the Nmap execution had not finished at least one host? In that case there is no use \"resuming\"", fname);

I chose arbitrarily the new value of "1024*128" but it seems large enough while being a reasonable size (131ko). Also based on this, but it is not a definite answer:
With the patch I can confirm that my scan can properly resume.

As a side note, I think that the displayed error message has no relation with the issue here.

Copy link

@nnposter nnposter commented Jul 14, 2019

There is a 4K limitation in arg_parse() so I assume that your specific scan had to fit into that. I have increased the resume buffer accordingly.

Thank you for contributing to nmap.

@nnposter nnposter self-assigned this Jul 14, 2019
@nnposter nnposter added bug Nmap labels Jul 14, 2019
@nmap-bot nmap-bot closed this in 4e6fef4 Jul 14, 2019
@cnotin cnotin deleted the cnotin:patch-10 branch Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.