mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
o Moved the parse_long function from ncat to nbase for better reuse,
and used it to simplify netmask parsing code. This patch was contributed by William Pursell.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o Moved the parse_long function from ncat to nbase for better reuse,
|
||||
and used it to simplify netmask parsing code. This patch was
|
||||
contributed by William Pursell.
|
||||
|
||||
o Added EPROTO to the list of known error codes in service scan. Daniel
|
||||
Miller reported that an EPROTO was causing Nmap to exit after sending
|
||||
the Sqlping probe during service scan. The error message was
|
||||
|
||||
@@ -187,17 +187,12 @@ int TargetGroup::parse_expr(const char * const target_expr, int af) {
|
||||
|
||||
*s = '\0'; /* Make sure target_net is terminated before the /## */
|
||||
s++; /* Point s at the netmask */
|
||||
if (!isdigit((int) (unsigned char) *s)) {
|
||||
netmask_long = parse_long(s, (char**) &tail);
|
||||
if (*tail != '\0' || tail == s || netmask_long < 0 || netmask_long > 32) {
|
||||
error("Illegal netmask value, must be /0 - /32 . Assuming /32 (one host)");
|
||||
netmask = 32;
|
||||
} else {
|
||||
netmask_long = strtol(s, (char**) &tail, 10);
|
||||
if (*tail != '\0' || tail == s || netmask_long < 0 || netmask_long > 32) {
|
||||
error("Illegal netmask value, must be /0 - /32 . Assuming /32 (one host)");
|
||||
netmask = 32;
|
||||
} else
|
||||
} else
|
||||
netmask = (u32) netmask_long;
|
||||
}
|
||||
} else
|
||||
netmask = 32;
|
||||
resolvedname = hostexp;
|
||||
|
||||
Reference in New Issue
Block a user