From 09eef559c3d54ec2fc5e5bbf865d98a8850cbc45 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 29 Jul 2016 15:50:48 +0000 Subject: [PATCH] Bounce scan: avoid array overrun (read) by checking index instead --- nmap_ftp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmap_ftp.cc b/nmap_ftp.cc index 6cd8435ba..0f73b9481 100644 --- a/nmap_ftp.cc +++ b/nmap_ftp.cc @@ -339,7 +339,7 @@ void bounce_scan(Target *target, u16 *portarray, int numports, } else { error("Your FTP bounce server doesn't allow privileged ports, skipping them."); while (i < numports && portarray[i] < 1024) i++; - if (!portarray[i]) { + if (i >= numports) { fatal("And you didn't want to scan any unprivileged ports. Giving up."); } }