Skip to content

Commit

Permalink
Merge pull request #323 from jjnicola/cidr-block-11
Browse files Browse the repository at this point in the history
[11.0] Fix is_cidr_block().
  • Loading branch information
mattmundell authored Mar 26, 2020
2 parents 2aa6f49 + 2fa39eb commit de03ef1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Prevent g_strsplit to be called with NULL. [#238](https://github.com/greenbone/gvm-libs/pull/238)
- Check filter before using it in osp_get_vts_ext. [#266](https://github.com/greenbone/gvm-libs/pull/266)
- Fix is_cidr_block(). [#323](https://github.com/greenbone/gvm-libs/pull/323)

### Removed
- Remove inconsistent delays in kb routines. [#230](https://github.com/greenbone/gvm-libs/pull/230)
Expand Down
7 changes: 5 additions & 2 deletions base/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,14 @@ is_cidr_block (const char *str)

p = NULL;
block = strtol (block_str, &p, 10);
g_free (addr_str);

if (*p || block <= 0 || block > 30)
return 0;
{
g_free (addr_str);
return 0;
}

g_free (addr_str);
return 1;
}

Expand Down

0 comments on commit de03ef1

Please sign in to comment.