From 29d2b20c9813703ac73e015115cf4b50ad135f49 Mon Sep 17 00:00:00 2001 From: doug Date: Wed, 28 May 2008 22:25:05 +0000 Subject: [PATCH] Added error message for improperly formatted port/protocol string. Thanks to David for finding this problem. --- nmap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nmap.cc b/nmap.cc index 926bf6ffd..f841bd047 100644 --- a/nmap.cc +++ b/nmap.cc @@ -2321,7 +2321,10 @@ static void getpts_aux(const char *origexpr, int nested, u8 *porttbl, int range_ /* Find the next range */ while(isspace((int) *current_range)) current_range++; - if (*current_range == ']') return; + if (*current_range == ']') { + if (!nested) fatal("Unexpected ] character in port/protocol specification"); + return; + } if (*current_range && *current_range != ',') { fatal("Error #488: Your port specifications are illegal. Example of proper form: \"%s\"", syntax_example);