Skip to content

Commit

Permalink
Bounce scan: avoid array overrun (read) by checking index instead
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Jul 29, 2016
1 parent b6dfce6 commit 09eef55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nmap_ftp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
Expand Down

0 comments on commit 09eef55

Please sign in to comment.