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 service probes max line length #2803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion service_scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ void ServiceProbe::addMatch(const char *match, int lineno) {
(servicematch) which use this */
void parse_nmap_service_probe_file(AllProbes *AP, const char *filename) {
ServiceProbe *newProbe = NULL;
char line[2048];
char line[16384];
int lineno = 0;
FILE *fp;

Expand Down Expand Up @@ -1331,6 +1331,10 @@ void parse_nmap_service_probe_file(AllProbes *AP, const char *filename) {
if (strncmp(line, "Probe ", 6) != 0)
fatal("Parse error on line %d of nmap-service-probes file: %s -- line was expected to begin with \"Probe \" or \"Exclude \"", lineno, filename);

if (strnlen(line, sizeof(line)) >= sizeof(line) - 1) {
fatal("Parse error on line %d of nmap-service-probes file: %s -- line is too long for buffer, max length is %lu", lineno, filename, sizeof(line));
}

newProbe = new ServiceProbe();
newProbe->setProbeDetails(line + 6, lineno);

Expand Down