mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 02:19:04 +00:00
Make Nmap quit when it gets a "backwards" port range like -p 20-10.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o Nmap quits if you give a "backwards" port or protocol range like
|
||||
-p 20-10. The issue was noted by Arturo "Buanzo" Busleiman. [David]
|
||||
|
||||
o Fixed a bug which caused Nmap to infer an improper distance against
|
||||
some hosts when performaing OS detection against a group whose
|
||||
distance varies between members. [David, Fyodor]
|
||||
|
||||
5
nmap.cc
5
nmap.cc
@@ -2347,6 +2347,11 @@ static void getpts_aux(const char *origexpr, int nested, u8 *porttbl, int range_
|
||||
} else {
|
||||
fatal("Error #486: Your port specifications are illegal. Example of proper form: \"%s\"", syntax_example);
|
||||
}
|
||||
if (rangeend < rangestart) {
|
||||
fatal("Your %s range %ld-%ld is backwards. Did you mean %ld-%ld?",
|
||||
(range_type & SCAN_PROTOCOLS) ? "protocol" : "port",
|
||||
rangestart, rangeend, rangeend, rangestart);
|
||||
}
|
||||
} else {
|
||||
fatal("Error #487: Your port specifications are illegal. Example of proper form: \"%s\"", syntax_example);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user