Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0] Fix is_cidr_block(). #323

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,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