mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Be more clear for static analysis (LGTM) that this does not overflow. #1834
This commit is contained in:
parent
ee95fa8d30
commit
0403751060
1 changed files with 3 additions and 3 deletions
|
|
@ -201,7 +201,7 @@ int TargetGroup::rewind() {
|
|||
* get_next_host should be used for skipping the last octet :-)
|
||||
* returns: number of hosts skipped */
|
||||
int TargetGroup::skip_range(_octet_nums octet) {
|
||||
unsigned long hosts_skipped = 0, /* number of hosts skipped */
|
||||
u32 hosts_skipped = 0, /* number of hosts skipped */
|
||||
oct = 0; /* octect number */
|
||||
int i = 0; /* simple lcv */
|
||||
|
||||
|
|
@ -212,11 +212,11 @@ int TargetGroup::skip_range(_octet_nums octet) {
|
|||
switch (octet) {
|
||||
case FIRST_OCTET:
|
||||
oct = 0;
|
||||
hosts_skipped = (last[1] + 1) * (last[2] + 1) * (last[3] + 1);
|
||||
hosts_skipped = (u32)(last[1] + 1) * (last[2] + 1) * (last[3] + 1);
|
||||
break;
|
||||
case SECOND_OCTET:
|
||||
oct = 1;
|
||||
hosts_skipped = (last[2] + 1) * (last[3] + 1);
|
||||
hosts_skipped = (u32)(last[2] + 1) * (last[3] + 1);
|
||||
break;
|
||||
case THIRD_OCTET:
|
||||
oct = 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue