1
0
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:
david
2008-10-20 01:58:58 +00:00
parent 976a27755d
commit 7c32907cac
2 changed files with 8 additions and 0 deletions

View File

@@ -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]

View File

@@ -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);
}