mirror of
https://github.com/nmap/nmap.git
synced 2026-06-29 12:44:00 +00:00
Avoid unlimited rate due to integer division. Fixes #1751
This commit is contained in:
parent
4c45907f76
commit
a5ee61bea2
1 changed files with 3 additions and 0 deletions
|
|
@ -872,6 +872,9 @@ int ArgParser::parseArguments(int argc, char *argv[]) {
|
|||
if (parse_u32(optarg, &aux32)==OP_SUCCESS){
|
||||
if(aux32==0){
|
||||
nping_fatal(QT_3,"Invalid rate supplied. Rate can never be zero.");
|
||||
}
|
||||
else if (aux32 > 1000) {
|
||||
nping_fatal(QT_3,"Rate must not exceed 1000. Use --delay 0 for unlimited rate.");
|
||||
}else{
|
||||
/* Compute delay from rate: delay= 1000ms/rate*/
|
||||
aux32 = 1000 / aux32;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue